From 9d36dd56a8e3cb6903ae06daf9120ff3e6512a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 2 Feb 2022 16:17:28 +0100 Subject: [PATCH] reordered includes in GUI code (#3790) --- gui/aboutdialog.h | 3 +- gui/applicationdialog.cpp | 6 +-- gui/applicationdialog.h | 3 +- gui/applicationlist.cpp | 10 ++--- gui/applicationlist.h | 3 +- gui/checkstatistics.h | 8 ++-- gui/checkthread.cpp | 9 ++-- gui/checkthread.h | 3 +- gui/codeeditor.cpp | 5 ++- gui/codeeditor.h | 2 +- gui/codeeditorstyle.cpp | 1 + gui/codeeditorstyle.h | 2 +- gui/codeeditstylecontrols.cpp | 1 + gui/codeeditstylecontrols.h | 4 +- gui/codeeditstyledialog.cpp | 3 +- gui/codeeditstyledialog.h | 3 +- gui/common.cpp | 5 ++- gui/csvreport.cpp | 3 +- gui/csvreport.h | 3 +- gui/erroritem.cpp | 1 + gui/erroritem.h | 7 +-- gui/filelist.cpp | 3 +- gui/fileviewdialog.cpp | 2 +- gui/fileviewdialog.h | 3 +- gui/functioncontractdialog.cpp | 1 + gui/helpdialog.cpp | 2 + gui/libraryaddfunctiondialog.cpp | 1 + gui/librarydialog.cpp | 6 ++- gui/librarydialog.h | 4 +- gui/libraryeditargdialog.cpp | 1 + gui/libraryeditargdialog.h | 3 +- gui/main.cpp | 25 ++++++----- gui/mainwindow.cpp | 27 ++++++----- gui/mainwindow.h | 9 ++-- gui/newsuppressiondialog.cpp | 2 + gui/newsuppressiondialog.h | 3 +- gui/platforms.h | 5 ++- gui/printablereport.cpp | 1 + gui/projectfile.cpp | 8 ++-- gui/projectfile.h | 8 ++-- gui/projectfiledialog.cpp | 19 ++++---- gui/projectfiledialog.h | 8 ++-- gui/report.h | 2 +- gui/resultstree.cpp | 45 ++++++++++--------- gui/resultstree.h | 5 ++- gui/resultsview.cpp | 33 +++++++------- gui/resultsview.h | 2 +- gui/scratchpad.cpp | 1 + gui/scratchpad.h | 3 +- gui/settingsdialog.cpp | 15 ++++--- gui/settingsdialog.h | 3 +- gui/showtypes.cpp | 2 +- gui/showtypes.h | 4 +- gui/statsdialog.cpp | 14 +++--- gui/statsdialog.h | 3 +- gui/test/benchmark/simple/benchmarksimple.cpp | 17 ++++--- gui/test/benchmark/simple/benchmarksimple.h | 5 ++- .../testcppchecklibrarydata.h | 3 +- gui/test/filelist/testfilelist.cpp | 8 ++-- gui/test/filelist/testfilelist.h | 2 +- gui/test/projectfile/testprojectfile.cpp | 4 +- gui/test/projectfile/testprojectfile.h | 2 +- .../testtranslationhandler.cpp | 4 +- .../testtranslationhandler.h | 2 +- gui/test/xmlreportv2/testxmlreportv2.cpp | 6 ++- gui/threadhandler.cpp | 11 ++--- gui/threadhandler.h | 12 ++--- gui/threadresult.cpp | 3 +- gui/threadresult.h | 7 +-- gui/translationhandler.cpp | 5 ++- gui/translationhandler.h | 4 +- gui/txtreport.cpp | 3 +- gui/txtreport.h | 3 +- gui/variablecontractsdialog.cpp | 1 + gui/xmlreport.cpp | 3 +- gui/xmlreport.h | 3 +- gui/xmlreportv2.cpp | 11 ++--- gui/xmlreportv2.h | 3 +- tools/triage/main.cpp | 1 + tools/triage/mainwindow.cpp | 17 ++++--- tools/triage/mainwindow.h | 2 +- 81 files changed, 286 insertions(+), 214 deletions(-) diff --git a/gui/aboutdialog.h b/gui/aboutdialog.h index 7ce305ec7..3e9343a20 100644 --- a/gui/aboutdialog.h +++ b/gui/aboutdialog.h @@ -19,9 +19,10 @@ #ifndef ABOUT_DIALOG_H #define ABOUT_DIALOG_H +#include "ui_about.h" + #include #include -#include "ui_about.h" class QWidget; diff --git a/gui/applicationdialog.cpp b/gui/applicationdialog.cpp index f30abbcb6..fa7f9ffdf 100644 --- a/gui/applicationdialog.cpp +++ b/gui/applicationdialog.cpp @@ -18,14 +18,14 @@ #include "applicationdialog.h" +#include "application.h" +#include "common.h" + #include #include #include #include -#include "application.h" -#include "common.h" - ApplicationDialog::ApplicationDialog(const QString &title, Application &app, diff --git a/gui/applicationdialog.h b/gui/applicationdialog.h index 0835a2dc8..fa71e183e 100644 --- a/gui/applicationdialog.h +++ b/gui/applicationdialog.h @@ -19,9 +19,10 @@ #ifndef APPLICATIONDIALOG_H #define APPLICATIONDIALOG_H +#include "ui_application.h" + #include #include -#include "ui_application.h" class QWidget; class Application; diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 38414fdf6..599175145 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -18,15 +18,15 @@ #include "applicationlist.h" +#include "application.h" +#include "common.h" + +#include + #include #include #include -#include "common.h" -#include "application.h" - -#include - ApplicationList::ApplicationList(QObject *parent) : QObject(parent), mDefaultApplicationIndex(-1) diff --git a/gui/applicationlist.h b/gui/applicationlist.h index 189ea62aa..d5776f2e9 100644 --- a/gui/applicationlist.h +++ b/gui/applicationlist.h @@ -19,9 +19,10 @@ #ifndef APPLICATIONLIST_H #define APPLICATIONLIST_H -#include #include "application.h" +#include + /// @addtogroup GUI /// @{ diff --git a/gui/checkstatistics.h b/gui/checkstatistics.h index fd82a298f..56e4b80e4 100644 --- a/gui/checkstatistics.h +++ b/gui/checkstatistics.h @@ -19,12 +19,12 @@ #ifndef CHECKSTATISTICS_H #define CHECKSTATISTICS_H -#include -#include -#include - #include "showtypes.h" +#include +#include +#include + /// @addtogroup GUI /// @{ diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp index d966f46b3..fb3134dc9 100644 --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -18,15 +18,16 @@ #include "checkthread.h" +#include "common.h" +#include "cppcheck.h" +#include "erroritem.h" +#include "threadresult.h" + #include #include #include #include #include -#include "erroritem.h" -#include "threadresult.h" -#include "cppcheck.h" -#include "common.h" static bool executeCommand(std::string exe, std::vector args, std::string redirect, std::string *output) { diff --git a/gui/checkthread.h b/gui/checkthread.h index 50a0685a5..4bd6e7944 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -20,10 +20,11 @@ #ifndef CHECKTHREAD_H #define CHECKTHREAD_H -#include #include "cppcheck.h" #include "suppressions.h" +#include + class Settings; class ThreadResult; diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index 08f602660..33a04129b 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -18,10 +18,11 @@ #include "codeeditor.h" -#include -#include #include "codeeditorstyle.h" +#include +#include + Highlighter::Highlighter(QTextDocument *parent, CodeEditorStyle *widgetStyle) : diff --git a/gui/codeeditor.h b/gui/codeeditor.h index df771cfc8..72d9d0a6a 100644 --- a/gui/codeeditor.h +++ b/gui/codeeditor.h @@ -19,9 +19,9 @@ #ifndef CODEEDITOR_H #define CODEEDITOR_H -#include #include #include +#include class CodeEditorStyle; class QPaintEvent; diff --git a/gui/codeeditorstyle.cpp b/gui/codeeditorstyle.cpp index 0fecc7cfe..f9be20cc7 100644 --- a/gui/codeeditorstyle.cpp +++ b/gui/codeeditorstyle.cpp @@ -17,6 +17,7 @@ */ #include "codeeditorstyle.h" + #include CodeEditorStyle::CodeEditorStyle( diff --git a/gui/codeeditorstyle.h b/gui/codeeditorstyle.h index 445dba271..908c6aa37 100644 --- a/gui/codeeditorstyle.h +++ b/gui/codeeditorstyle.h @@ -19,9 +19,9 @@ #ifndef CODEEDITORSTYLE_H #define CODEEDITORSTYLE_H -#include #include #include +#include const QString SETTINGS_STYLE_GROUP("EditorStyle"); const QString SETTINGS_STYLE_TYPE("StyleType"); diff --git a/gui/codeeditstylecontrols.cpp b/gui/codeeditstylecontrols.cpp index 79c6b288b..435bba561 100644 --- a/gui/codeeditstylecontrols.cpp +++ b/gui/codeeditstylecontrols.cpp @@ -17,6 +17,7 @@ */ #include "codeeditstylecontrols.h" + #include SelectColorButton::SelectColorButton(QWidget* parent) : diff --git a/gui/codeeditstylecontrols.h b/gui/codeeditstylecontrols.h index 03fab0ba7..bff81c875 100644 --- a/gui/codeeditstylecontrols.h +++ b/gui/codeeditstylecontrols.h @@ -22,10 +22,10 @@ #ifndef CODEEDITORSTYLECONTROLS_H #define CODEEDITORSTYLECONTROLS_H -#include -#include #include +#include #include +#include class SelectColorButton : public QPushButton { Q_OBJECT diff --git a/gui/codeeditstyledialog.cpp b/gui/codeeditstyledialog.cpp index 305c68d2c..a0e4b384a 100644 --- a/gui/codeeditstyledialog.cpp +++ b/gui/codeeditstyledialog.cpp @@ -20,8 +20,9 @@ #include "codeeditor.h" #include "codeeditstylecontrols.h" -#include + #include +#include const QString StyleEditDialog::mSampleDocument( "/*****\n" diff --git a/gui/codeeditstyledialog.h b/gui/codeeditstyledialog.h index 6efc90542..6919a528f 100644 --- a/gui/codeeditstyledialog.h +++ b/gui/codeeditstyledialog.h @@ -19,9 +19,10 @@ #ifndef CODEEDITSTYLEDIALOG_H #define CODEEDITSTYLEDIALOG_H -#include #include "codeeditorstyle.h" +#include + class CodeEditor; class SelectColorButton; class SelectFontWeightCombo; diff --git a/gui/common.cpp b/gui/common.cpp index e43736988..3b40545af 100644 --- a/gui/common.cpp +++ b/gui/common.cpp @@ -18,10 +18,11 @@ #include "common.h" + #include -#include -#include #include +#include +#include QString getPath(const QString &type) diff --git a/gui/csvreport.cpp b/gui/csvreport.cpp index a056dc45f..c3ba24556 100644 --- a/gui/csvreport.cpp +++ b/gui/csvreport.cpp @@ -18,10 +18,11 @@ #include "csvreport.h" -#include #include "erroritem.h" #include "report.h" +#include + CsvReport::CsvReport(const QString &filename) : Report(filename) {} diff --git a/gui/csvreport.h b/gui/csvreport.h index 9802e1ef3..24afbce50 100644 --- a/gui/csvreport.h +++ b/gui/csvreport.h @@ -19,9 +19,10 @@ #ifndef CSV_REPORT_H #define CSV_REPORT_H +#include "report.h" + #include #include -#include "report.h" /// @addtogroup GUI /// @{ diff --git a/gui/erroritem.cpp b/gui/erroritem.cpp index f474da985..2005eafc9 100644 --- a/gui/erroritem.cpp +++ b/gui/erroritem.cpp @@ -17,6 +17,7 @@ */ #include "erroritem.h" + #include "common.h" QErrorPathItem::QErrorPathItem(const ErrorMessage::FileLocation &loc) diff --git a/gui/erroritem.h b/gui/erroritem.h index f18641931..dd7857a42 100644 --- a/gui/erroritem.h +++ b/gui/erroritem.h @@ -19,11 +19,12 @@ #ifndef ERRORITEM_H #define ERRORITEM_H -#include -#include -#include #include "errorlogger.h" +#include +#include +#include + /// @addtogroup GUI /// @{ diff --git a/gui/filelist.cpp b/gui/filelist.cpp index e06a53089..b21ffb3ef 100644 --- a/gui/filelist.cpp +++ b/gui/filelist.cpp @@ -18,9 +18,10 @@ #include "filelist.h" -#include #include "pathmatch.h" +#include + QStringList FileList::getDefaultFilters() { QStringList extensions; diff --git a/gui/fileviewdialog.cpp b/gui/fileviewdialog.cpp index 45bb2565b..f66f64843 100644 --- a/gui/fileviewdialog.cpp +++ b/gui/fileviewdialog.cpp @@ -18,8 +18,8 @@ #include "fileviewdialog.h" -#include #include +#include #include #include diff --git a/gui/fileviewdialog.h b/gui/fileviewdialog.h index 54d579035..a565a76b2 100644 --- a/gui/fileviewdialog.h +++ b/gui/fileviewdialog.h @@ -19,9 +19,10 @@ #ifndef FILEVIEW_DIALOG_H #define FILEVIEW_DIALOG_H +#include "ui_file.h" + #include #include -#include "ui_file.h" class QWidget; class QTextEdit; diff --git a/gui/functioncontractdialog.cpp b/gui/functioncontractdialog.cpp index bc438fb16..d5e6ba239 100644 --- a/gui/functioncontractdialog.cpp +++ b/gui/functioncontractdialog.cpp @@ -17,6 +17,7 @@ */ #include "functioncontractdialog.h" + #include "ui_functioncontractdialog.h" static QString formatFunctionName(QString f) diff --git a/gui/helpdialog.cpp b/gui/helpdialog.cpp index 0785e2a54..82ebea5e0 100644 --- a/gui/helpdialog.cpp +++ b/gui/helpdialog.cpp @@ -17,7 +17,9 @@ */ #include "helpdialog.h" + #include "ui_helpdialog.h" + #include "common.h" #include diff --git a/gui/libraryaddfunctiondialog.cpp b/gui/libraryaddfunctiondialog.cpp index 54fa2fd7b..f4905f325 100644 --- a/gui/libraryaddfunctiondialog.cpp +++ b/gui/libraryaddfunctiondialog.cpp @@ -17,6 +17,7 @@ */ #include "libraryaddfunctiondialog.h" + #include "ui_libraryaddfunctiondialog.h" #include diff --git a/gui/librarydialog.cpp b/gui/librarydialog.cpp index aaf666cd7..76245e87e 100644 --- a/gui/librarydialog.cpp +++ b/gui/librarydialog.cpp @@ -17,16 +17,18 @@ */ #include "librarydialog.h" + #include "ui_librarydialog.h" + +#include "common.h" #include "libraryaddfunctiondialog.h" #include "libraryeditargdialog.h" -#include "common.h" #include "path.h" #include #include -#include #include +#include // TODO: get/compare functions from header diff --git a/gui/librarydialog.h b/gui/librarydialog.h index d639a1d86..d7c46d41d 100644 --- a/gui/librarydialog.h +++ b/gui/librarydialog.h @@ -19,10 +19,10 @@ #ifndef LIBRARYDIALOG_H #define LIBRARYDIALOG_H -#include - #include "cppchecklibrarydata.h" +#include + class QListWidgetItem; namespace Ui { diff --git a/gui/libraryeditargdialog.cpp b/gui/libraryeditargdialog.cpp index 041f50f44..faf890cb5 100644 --- a/gui/libraryeditargdialog.cpp +++ b/gui/libraryeditargdialog.cpp @@ -17,6 +17,7 @@ */ #include "libraryeditargdialog.h" + #include "ui_libraryeditargdialog.h" LibraryEditArgDialog::LibraryEditArgDialog(QWidget *parent, const CppcheckLibraryData::Function::Arg &arg) : diff --git a/gui/libraryeditargdialog.h b/gui/libraryeditargdialog.h index b89798f8d..10c845292 100644 --- a/gui/libraryeditargdialog.h +++ b/gui/libraryeditargdialog.h @@ -19,9 +19,10 @@ #ifndef LIBRARYEDITARGDIALOG_H #define LIBRARYEDITARGDIALOG_H -#include #include "cppchecklibrarydata.h" +#include + namespace Ui { class LibraryEditArgDialog; } diff --git a/gui/main.cpp b/gui/main.cpp index 2e2a91c92..b57eb7d6f 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -16,23 +16,26 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#include "aboutdialog.h" -#else -#include -#endif #include "cppcheck.h" #include "common.h" #include "mainwindow.h" #include "erroritem.h" #include "translationhandler.h" +#ifdef _WIN32 +#include "aboutdialog.h" + +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + static void ShowUsage(); static void ShowVersion(); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index ca0b14cae..8dc1504a5 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -18,23 +18,10 @@ #include "mainwindow.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cppcheck.h" - #include "applicationlist.h" #include "aboutdialog.h" #include "common.h" +#include "cppcheck.h" #include "filelist.h" #include "fileviewdialog.h" #include "functioncontractdialog.h" @@ -52,6 +39,18 @@ #include "translationhandler.h" #include "variablecontractsdialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + static const QString OnlineHelpURL("https://cppcheck.sourceforge.io/manual.html"); static const QString compile_commands_json("compile_commands.json"); diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 3348cfa43..c175af3b2 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -19,13 +19,14 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include -#include -#include +#include "ui_mainwindow.h" #include "settings.h" #include "platforms.h" -#include "ui_mainwindow.h" + +#include +#include +#include class ThreadHandler; class TranslationHandler; diff --git a/gui/newsuppressiondialog.cpp b/gui/newsuppressiondialog.cpp index 28104129d..20c5f693b 100644 --- a/gui/newsuppressiondialog.cpp +++ b/gui/newsuppressiondialog.cpp @@ -17,7 +17,9 @@ */ #include "newsuppressiondialog.h" + #include "ui_newsuppressiondialog.h" + #include "cppcheck.h" #include "color.h" #include "errorlogger.h" diff --git a/gui/newsuppressiondialog.h b/gui/newsuppressiondialog.h index 2d3c29b9a..9b1fbe3a5 100644 --- a/gui/newsuppressiondialog.h +++ b/gui/newsuppressiondialog.h @@ -19,9 +19,10 @@ #ifndef NEWSUPPRESSIONDIALOG_H #define NEWSUPPRESSIONDIALOG_H -#include #include "suppressions.h" +#include + namespace Ui { class NewSuppressionDialog; } diff --git a/gui/platforms.h b/gui/platforms.h index 94c6b6299..6515a53ba 100644 --- a/gui/platforms.h +++ b/gui/platforms.h @@ -19,10 +19,11 @@ #ifndef PLATFORMS_H #define PLATFORMS_H +#include "settings.h" + +#include #include #include -#include -#include "settings.h" class QAction; diff --git a/gui/printablereport.cpp b/gui/printablereport.cpp index 2770cc0ef..0a0f72829 100644 --- a/gui/printablereport.cpp +++ b/gui/printablereport.cpp @@ -19,6 +19,7 @@ #include "printablereport.h" #include "erroritem.h" + #include PrintableReport::PrintableReport() : diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index 9471ffac7..d11b16e70 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -18,13 +18,13 @@ #include "projectfile.h" +#include "common.h" +#include "importproject.h" +#include "settings.h" + #include #include #include -#include "common.h" -#include "importproject.h" - -#include "settings.h" ProjectFile *ProjectFile::mActiveProject; diff --git a/gui/projectfile.h b/gui/projectfile.h index 2341634bc..38bbf0632 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -19,15 +19,15 @@ #ifndef PROJECT_FILE_H #define PROJECT_FILE_H +#include "settings.h" +#include "suppressions.h" + #include + #include #include #include -#include "suppressions.h" - -#include - class QXmlStreamReader; class QXmlStreamWriter; diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 07c9a83c2..11dc763af 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -18,17 +18,18 @@ #include "projectfiledialog.h" -#include -#include -#include -#include -#include "common.h" -#include "newsuppressiondialog.h" #include "checkthread.h" -#include "projectfile.h" -#include "library.h" -#include "platforms.h" +#include "common.h" #include "importproject.h" +#include "library.h" +#include "newsuppressiondialog.h" +#include "platforms.h" +#include "projectfile.h" + +#include +#include +#include +#include /** Return paths from QListWidget */ static QStringList getPaths(const QListWidget *list) diff --git a/gui/projectfiledialog.h b/gui/projectfiledialog.h index 5c0025728..1e327e265 100644 --- a/gui/projectfiledialog.h +++ b/gui/projectfiledialog.h @@ -19,13 +19,13 @@ #ifndef PROJECTFILE_DIALOG_H #define PROJECTFILE_DIALOG_H -#include -#include -#include +#include "ui_projectfiledialog.h" #include "suppressions.h" -#include "ui_projectfiledialog.h" +#include +#include +#include class QWidget; class QCheckBox; diff --git a/gui/report.h b/gui/report.h index 8b2edee84..264dd40a9 100644 --- a/gui/report.h +++ b/gui/report.h @@ -19,9 +19,9 @@ #ifndef REPORT_H #define REPORT_H +#include #include #include -#include class ErrorItem; diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index db6309405..289091e18 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -18,35 +18,36 @@ #include "resultstree.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "application.h" +#include "applicationlist.h" #include "common.h" #include "erroritem.h" -#include "applicationlist.h" -#include "report.h" -#include "application.h" +#include "path.h" #include "projectfile.h" +#include "report.h" #include "showtypes.h" #include "threadhandler.h" -#include "path.h" #include "xmlreportv2.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + static const char COLUMN[] = "column"; static const char CWE[] = "cwe"; static const char ERRORID[] = "id"; diff --git a/gui/resultstree.h b/gui/resultstree.h index 12114485d..0f1529305 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -20,11 +20,12 @@ #ifndef RESULTSTREE_H #define RESULTSTREE_H -#include -#include #include "errortypes.h" #include "showtypes.h" +#include +#include + class ApplicationList; class Report; class ErrorItem; diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 8470258a0..b40fd8d88 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -18,27 +18,28 @@ #include "resultsview.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "checkstatistics.h" +#include "codeeditorstyle.h" #include "common.h" +#include "csvreport.h" #include "erroritem.h" +#include "path.h" +#include "printablereport.h" #include "txtreport.h" #include "xmlreport.h" #include "xmlreportv2.h" -#include "csvreport.h" -#include "printablereport.h" -#include "checkstatistics.h" -#include "path.h" -#include "codeeditorstyle.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include ResultsView::ResultsView(QWidget * parent) : QWidget(parent), diff --git a/gui/resultsview.h b/gui/resultsview.h index 41b53e8eb..c6d85b35e 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -20,10 +20,10 @@ #ifndef RESULTSVIEW_H #define RESULTSVIEW_H +#include "ui_resultsview.h" #include "report.h" #include "showtypes.h" -#include "ui_resultsview.h" class ErrorItem; class ApplicationList; diff --git a/gui/scratchpad.cpp b/gui/scratchpad.cpp index 5b57b9d22..2634acbf5 100644 --- a/gui/scratchpad.cpp +++ b/gui/scratchpad.cpp @@ -17,6 +17,7 @@ */ #include "scratchpad.h" + #include "mainwindow.h" ScratchPad::ScratchPad(MainWindow& mainWindow) diff --git a/gui/scratchpad.h b/gui/scratchpad.h index d60cd22c9..49e8aef7a 100644 --- a/gui/scratchpad.h +++ b/gui/scratchpad.h @@ -19,9 +19,10 @@ #ifndef SCRATCHPAD_H #define SCRATCHPAD_H -#include #include "ui_scratchpad.h" +#include + class MainWindow; /// @addtogroup GUI diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 0a07c73af..cac5895d3 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -18,18 +18,19 @@ #include "settingsdialog.h" -#include -#include -#include -#include -#include -#include #include "applicationdialog.h" #include "applicationlist.h" -#include "translationhandler.h" #include "codeeditorstyle.h" #include "codeeditstyledialog.h" #include "common.h" +#include "translationhandler.h" + +#include +#include +#include +#include +#include +#include SettingsDialog::SettingsDialog(ApplicationList *list, TranslationHandler *translator, diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index 90b7185d7..94caa8f06 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -20,9 +20,10 @@ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H -#include #include "ui_settings.h" +#include + class QSettings; class QWidget; class ApplicationList; diff --git a/gui/showtypes.cpp b/gui/showtypes.cpp index 03d3f4286..0c636ebee 100644 --- a/gui/showtypes.cpp +++ b/gui/showtypes.cpp @@ -20,8 +20,8 @@ #include "common.h" -#include #include +#include #include ShowTypes::ShowTypes() diff --git a/gui/showtypes.h b/gui/showtypes.h index fa2edfbec..ee1c363ae 100644 --- a/gui/showtypes.h +++ b/gui/showtypes.h @@ -19,10 +19,10 @@ #ifndef SHOWTYPES_H #define SHOWTYPES_H -#include - #include "errortypes.h" +#include + /// @addtogroup GUI /// @{ diff --git a/gui/statsdialog.cpp b/gui/statsdialog.cpp index 50b2125cd..525c9c96d 100644 --- a/gui/statsdialog.cpp +++ b/gui/statsdialog.cpp @@ -18,18 +18,18 @@ #include "statsdialog.h" -#include +#include "checkstatistics.h" +#include "common.h" +#include "projectfile.h" + +#include #include #include #include +#include +#include #include #include -#include -#include - -#include "projectfile.h" -#include "checkstatistics.h" -#include "common.h" static const QString CPPCHECK("cppcheck"); diff --git a/gui/statsdialog.h b/gui/statsdialog.h index b1886d951..66516cd7b 100644 --- a/gui/statsdialog.h +++ b/gui/statsdialog.h @@ -19,11 +19,12 @@ #ifndef STATSDIALOG_H #define STATSDIALOG_H +#include "ui_stats.h" + #include #ifdef HAVE_QCHART #include #endif -#include "ui_stats.h" class ProjectFile; class CheckStatistics; diff --git a/gui/test/benchmark/simple/benchmarksimple.cpp b/gui/test/benchmark/simple/benchmarksimple.cpp index 510cf6685..139afecb9 100644 --- a/gui/test/benchmark/simple/benchmarksimple.cpp +++ b/gui/test/benchmark/simple/benchmarksimple.cpp @@ -16,15 +16,18 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include #include "benchmarksimple.h" -#include "tokenize.h" -#include "token.h" + #include "settings.h" +#include "token.h" +#include "tokenize.h" + +#include + +#include +#include +#include +#include void BenchmarkSimple::tokenize() { diff --git a/gui/test/benchmark/simple/benchmarksimple.h b/gui/test/benchmark/simple/benchmarksimple.h index a90a380e7..1f021700f 100644 --- a/gui/test/benchmark/simple/benchmarksimple.h +++ b/gui/test/benchmark/simple/benchmarksimple.h @@ -16,10 +16,11 @@ * along with this program. If not, see . */ -#include -#include #include "errorlogger.h" +#include +#include + class BenchmarkSimple : public QObject, public ErrorLogger { Q_OBJECT diff --git a/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h b/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h index 91fcb6e71..fdc1120f9 100644 --- a/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h +++ b/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -#include #include "cppchecklibrarydata.h" +#include + class TestCppcheckLibraryData : public QObject { Q_OBJECT diff --git a/gui/test/filelist/testfilelist.cpp b/gui/test/filelist/testfilelist.cpp index 8f496c58c..51dc9bea0 100644 --- a/gui/test/filelist/testfilelist.cpp +++ b/gui/test/filelist/testfilelist.cpp @@ -16,12 +16,14 @@ * along with this program. If not, see . */ -#include -#include -#include #include "testfilelist.h" + #include "filelist.h" +#include +#include +#include + void TestFileList::addFile() { // Accepted extensions: *.cpp, *.cxx, *.cc, *.c, *.c++, *.txx, *.tpp, *.ipp, *.ixx" diff --git a/gui/test/filelist/testfilelist.h b/gui/test/filelist/testfilelist.h index ac299b818..698d60569 100644 --- a/gui/test/filelist/testfilelist.h +++ b/gui/test/filelist/testfilelist.h @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -#include #include +#include class TestFileList : public QObject { Q_OBJECT diff --git a/gui/test/projectfile/testprojectfile.cpp b/gui/test/projectfile/testprojectfile.cpp index 048a49143..e913780fc 100644 --- a/gui/test/projectfile/testprojectfile.cpp +++ b/gui/test/projectfile/testprojectfile.cpp @@ -16,11 +16,13 @@ * along with this program. If not, see . */ -#include #include "testprojectfile.h" + #include "projectfile.h" #include "settings.h" +#include + // Mock... const char Settings::SafeChecks::XmlRootName[] = "safe-checks"; const char Settings::SafeChecks::XmlClasses[] = "class-public"; diff --git a/gui/test/projectfile/testprojectfile.h b/gui/test/projectfile/testprojectfile.h index f48faf41e..31a49ebd4 100644 --- a/gui/test/projectfile/testprojectfile.h +++ b/gui/test/projectfile/testprojectfile.h @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -#include #include +#include class TestProjectFile : public QObject { Q_OBJECT diff --git a/gui/test/translationhandler/testtranslationhandler.cpp b/gui/test/translationhandler/testtranslationhandler.cpp index 6500b1ec2..a3d188aab 100644 --- a/gui/test/translationhandler/testtranslationhandler.cpp +++ b/gui/test/translationhandler/testtranslationhandler.cpp @@ -16,10 +16,12 @@ * along with this program. If not, see . */ -#include #include "testtranslationhandler.h" + #include "translationhandler.h" +#include + static const QStringList getTranslationNames(const TranslationHandler& handler) { QStringList names; diff --git a/gui/test/translationhandler/testtranslationhandler.h b/gui/test/translationhandler/testtranslationhandler.h index 2c57a3cc2..534890003 100644 --- a/gui/test/translationhandler/testtranslationhandler.h +++ b/gui/test/translationhandler/testtranslationhandler.h @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -#include #include +#include class TestTranslationHandler : public QObject { Q_OBJECT diff --git a/gui/test/xmlreportv2/testxmlreportv2.cpp b/gui/test/xmlreportv2/testxmlreportv2.cpp index 47774c114..c06c538c7 100644 --- a/gui/test/xmlreportv2/testxmlreportv2.cpp +++ b/gui/test/xmlreportv2/testxmlreportv2.cpp @@ -16,10 +16,12 @@ * along with this program. If not, see . */ -#include #include "testxmlreportv2.h" -#include "xmlreportv2.h" + #include "erroritem.h" +#include "xmlreportv2.h" + +#include void TestXmlReportV2::readXml() { diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 80b3c53fd..d2eb39b30 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -18,13 +18,14 @@ #include "threadhandler.h" -#include -#include -#include -#include "common.h" -#include "settings.h" #include "checkthread.h" +#include "common.h" #include "resultsview.h" +#include "settings.h" + +#include +#include +#include ThreadHandler::ThreadHandler(QObject *parent) : QObject(parent), diff --git a/gui/threadhandler.h b/gui/threadhandler.h index c2cc2d34f..4b3fc5e73 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -20,13 +20,15 @@ #ifndef THREADHANDLER_H #define THREADHANDLER_H -#include -#include +#include "suppressions.h" +#include "threadresult.h" + +#include + #include #include -#include -#include "threadresult.h" -#include "suppressions.h" +#include +#include class ResultsView; class CheckThread; diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index b2d173e4e..ecaa0ba4b 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -18,11 +18,12 @@ #include "threadresult.h" -#include #include "common.h" #include "erroritem.h" #include "errorlogger.h" +#include + ThreadResult::ThreadResult() : QObject(), ErrorLogger(), mMaxProgress(0), mProgress(0), mFilesChecked(0), mTotalFiles(0) { //ctor diff --git a/gui/threadresult.h b/gui/threadresult.h index 7a5316dce..fde6e32cf 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -20,13 +20,14 @@ #ifndef THREADRESULT_H #define THREADRESULT_H -#include -#include -#include #include "color.h" #include "errorlogger.h" #include "importproject.h" +#include +#include +#include + class ErrorItem; /// @addtogroup GUI diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp index eac429265..ddfc6b9e4 100644 --- a/gui/translationhandler.cpp +++ b/gui/translationhandler.cpp @@ -18,13 +18,14 @@ #include "translationhandler.h" +#include "common.h" + #include #include +#include #include #include -#include #include -#include "common.h" // Provide own translations for standard buttons. This (garbage) code is needed to enforce them to appear in .ts files even after "lupdate gui.pro" diff --git a/gui/translationhandler.h b/gui/translationhandler.h index ab96c2132..4e644bc18 100644 --- a/gui/translationhandler.h +++ b/gui/translationhandler.h @@ -19,9 +19,9 @@ #ifndef TRANSLATIONHANDLER_H #define TRANSLATIONHANDLER_H -#include -#include #include +#include +#include class QTranslator; diff --git a/gui/txtreport.cpp b/gui/txtreport.cpp index 304cafe71..f0b25c6b6 100644 --- a/gui/txtreport.cpp +++ b/gui/txtreport.cpp @@ -18,9 +18,10 @@ #include "txtreport.h" -#include #include "erroritem.h" +#include + TxtReport::TxtReport(const QString &filename) : Report(filename) {} diff --git a/gui/txtreport.h b/gui/txtreport.h index 71530ba76..0437494ba 100644 --- a/gui/txtreport.h +++ b/gui/txtreport.h @@ -19,9 +19,10 @@ #ifndef TXT_REPORT_H #define TXT_REPORT_H +#include "report.h" + #include #include -#include "report.h" /// @addtogroup GUI /// @{ diff --git a/gui/variablecontractsdialog.cpp b/gui/variablecontractsdialog.cpp index e0ae1f53f..77c2f5d7e 100644 --- a/gui/variablecontractsdialog.cpp +++ b/gui/variablecontractsdialog.cpp @@ -17,6 +17,7 @@ */ #include "variablecontractsdialog.h" + #include "ui_variablecontractsdialog.h" #include diff --git a/gui/xmlreport.cpp b/gui/xmlreport.cpp index 312b23f90..5295bbabb 100644 --- a/gui/xmlreport.cpp +++ b/gui/xmlreport.cpp @@ -18,9 +18,10 @@ #include "xmlreport.h" +#include "report.h" + #include #include -#include "report.h" static const char ResultElementName[] = "results"; static const char VersionAttribute[] = "version"; diff --git a/gui/xmlreport.h b/gui/xmlreport.h index 10ef6a71a..5f440304e 100644 --- a/gui/xmlreport.h +++ b/gui/xmlreport.h @@ -19,9 +19,10 @@ #ifndef XML_REPORT_H #define XML_REPORT_H +#include "report.h" + #include #include -#include "report.h" class ErrorItem; diff --git a/gui/xmlreportv2.cpp b/gui/xmlreportv2.cpp index 66339224d..438477cf8 100644 --- a/gui/xmlreportv2.cpp +++ b/gui/xmlreportv2.cpp @@ -18,13 +18,14 @@ #include "xmlreportv2.h" +#include "cppcheck.h" +#include "erroritem.h" +#include "report.h" +#include "xmlreport.h" + +#include #include #include -#include -#include "report.h" -#include "erroritem.h" -#include "xmlreport.h" -#include "cppcheck.h" static const QString ResultElementName = "results"; static const QString CppcheckElementName = "cppcheck"; diff --git a/gui/xmlreportv2.h b/gui/xmlreportv2.h index edc0d42bc..d67dec2f2 100644 --- a/gui/xmlreportv2.h +++ b/gui/xmlreportv2.h @@ -19,9 +19,10 @@ #ifndef XML_REPORTV2_H #define XML_REPORTV2_H -#include #include "xmlreport.h" +#include + class QXmlStreamReader; class QXmlStreamWriter; diff --git a/tools/triage/main.cpp b/tools/triage/main.cpp index 1ee5b8a0f..89564a19b 100644 --- a/tools/triage/main.cpp +++ b/tools/triage/main.cpp @@ -17,6 +17,7 @@ */ #include "mainwindow.h" + #include int main(int argc, char *argv[]) diff --git a/tools/triage/mainwindow.cpp b/tools/triage/mainwindow.cpp index a3587b54c..f278a0164 100644 --- a/tools/triage/mainwindow.cpp +++ b/tools/triage/mainwindow.cpp @@ -17,19 +17,22 @@ */ #include "mainwindow.h" + #include "ui_mainwindow.h" + +#include +#include + #include -#include -#include -#include #include #include -#include +#include #include -#include +#include #include -#include -#include +#include +#include +#include const QString WORK_FOLDER(QDir::homePath() + "/triage"); const QString DACA2_PACKAGES(QDir::homePath() + "/daca2-packages"); diff --git a/tools/triage/mainwindow.h b/tools/triage/mainwindow.h index 1e62b6129..3b9d9283f 100644 --- a/tools/triage/mainwindow.h +++ b/tools/triage/mainwindow.h @@ -19,9 +19,9 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H +#include #include #include -#include class QListWidgetItem; class QTextStream;