From b1a768e5ecf97c985576224ac8a2552e4db28fb5 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 7 Oct 2012 12:25:34 +0200 Subject: [PATCH] Cleanup of includes in GUI (Removed redundant includes, use forward declarations) - Build speedup by 3% in VS10 (LINKCORE=yes, Qt 4.8.3) --- gui/applicationdialog.cpp | 1 - gui/applicationdialog.h | 1 - gui/applicationlist.cpp | 1 - gui/applicationlist.h | 1 - gui/checkstatistics.cpp | 1 - gui/checkstatistics.h | 1 - gui/checkthread.h | 3 ++- gui/csvreport.cpp | 1 - gui/csvreport.h | 2 -- gui/filelist.cpp | 1 - gui/filelist.h | 1 - gui/main.cpp | 1 - gui/mainwindow.cpp | 10 +++++----- gui/mainwindow.h | 8 +------- gui/projectfiledialog.cpp | 1 - gui/projectfiledialog.h | 2 -- gui/report.cpp | 1 - gui/report.h | 1 - gui/resultstree.cpp | 5 +---- gui/resultstree.h | 4 +--- gui/resultsview.cpp | 3 --- gui/resultsview.h | 2 -- gui/selectfilesdialog.cpp | 2 -- gui/settingsdialog.cpp | 3 --- gui/settingsdialog.h | 1 - gui/statsdialog.cpp | 1 - gui/threadhandler.cpp | 2 ++ gui/threadhandler.h | 9 +++++---- gui/threadresult.h | 1 - gui/txtreport.cpp | 2 -- gui/txtreport.h | 2 -- gui/xmlreportv1.cpp | 1 - gui/xmlreportv1.h | 2 -- gui/xmlreportv2.cpp | 1 - gui/xmlreportv2.h | 3 --- 35 files changed, 17 insertions(+), 65 deletions(-) diff --git a/gui/applicationdialog.cpp b/gui/applicationdialog.cpp index 70fc55f94..6b006ac86 100644 --- a/gui/applicationdialog.cpp +++ b/gui/applicationdialog.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include "applicationdialog.h" #include "application.h" diff --git a/gui/applicationdialog.h b/gui/applicationdialog.h index 308e7be73..7764bc8e6 100644 --- a/gui/applicationdialog.h +++ b/gui/applicationdialog.h @@ -20,7 +20,6 @@ #define APPLICATIONDIALOG_H #include -#include #include #include "application.h" #include "ui_application.h" diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 4a0db9ae0..eb89f2e61 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include #include #include #include diff --git a/gui/applicationlist.h b/gui/applicationlist.h index 7e99b7636..8337a170e 100644 --- a/gui/applicationlist.h +++ b/gui/applicationlist.h @@ -20,7 +20,6 @@ #define APPLICATIONLIST_H #include -#include #include "application.h" /// @addtogroup GUI diff --git a/gui/checkstatistics.cpp b/gui/checkstatistics.cpp index ac62600f2..ea6dab9e0 100644 --- a/gui/checkstatistics.cpp +++ b/gui/checkstatistics.cpp @@ -17,7 +17,6 @@ */ #include -#include "common.h" #include "checkstatistics.h" CheckStatistics::CheckStatistics(QObject *parent) diff --git a/gui/checkstatistics.h b/gui/checkstatistics.h index 0d4efbac5..2ee3d6f37 100644 --- a/gui/checkstatistics.h +++ b/gui/checkstatistics.h @@ -20,7 +20,6 @@ #define CHECKSTATISTICS_H #include -#include "common.h" #include "showtypes.h" /// @addtogroup GUI diff --git a/gui/checkthread.h b/gui/checkthread.h index 07f6e8d09..e8cb2d905 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -22,9 +22,10 @@ #include #include "cppcheck.h" -#include "settings.h" #include "threadresult.h" +class Settings; + /// @addtogroup GUI /// @{ diff --git a/gui/csvreport.cpp b/gui/csvreport.cpp index 9699790b8..b894f17aa 100644 --- a/gui/csvreport.cpp +++ b/gui/csvreport.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "report.h" #include "csvreport.h" diff --git a/gui/csvreport.h b/gui/csvreport.h index 87b37b4e7..192c01c75 100644 --- a/gui/csvreport.h +++ b/gui/csvreport.h @@ -21,8 +21,6 @@ #include #include -#include -#include #include #include "report.h" diff --git a/gui/filelist.cpp b/gui/filelist.cpp index 158f7bbbe..3ae34f64a 100644 --- a/gui/filelist.cpp +++ b/gui/filelist.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include "filelist.h" QStringList FileList::GetDefaultFilters() diff --git a/gui/filelist.h b/gui/filelist.h index 04eaa1e86..8e3e03c13 100644 --- a/gui/filelist.h +++ b/gui/filelist.h @@ -19,7 +19,6 @@ #ifndef FILELIST_H #define FILELIST_H -#include #include #include diff --git a/gui/main.cpp b/gui/main.cpp index 42c0cff7b..acd8c91e9 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #ifdef _WIN32 diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index b3dd3ed17..8d5f18629 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -18,12 +18,7 @@ #include #include -#include -#include -#include #include -#include -#include #include #include #include @@ -31,13 +26,18 @@ #include #include #include "mainwindow.h" +#include "cppcheck.h" +#include "applicationlist.h" #include "aboutdialog.h" +#include "common.h" #include "threadhandler.h" #include "fileviewdialog.h" #include "projectfile.h" #include "project.h" #include "report.h" #include "statsdialog.h" +#include "settingsdialog.h" +#include "translationhandler.h" #include "logview.h" #include "filelist.h" #include "showtypes.h" diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 33daf1007..62c6a5652 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -22,26 +22,20 @@ #include #include #include -#include #include #include -#include #include -#include "resultsview.h" -#include "settingsdialog.h" -#include "translationhandler.h" #include "settings.h" #include "platforms.h" #include "ui_main.h" class ThreadHandler; +class TranslationHandler; class LogView; class Project; class ErrorItem; -class StatsDialog; class QAction; -class QActionGroup; /// @addtogroup GUI /// @{ diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 405e5bdc5..ea9007c2a 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include "common.h" diff --git a/gui/projectfiledialog.h b/gui/projectfiledialog.h index bda8e3dea..702b434da 100644 --- a/gui/projectfiledialog.h +++ b/gui/projectfiledialog.h @@ -25,9 +25,7 @@ #include "ui_projectfile.h" -class ProjectFile; class QWidget; -class QLineEdit; /// @addtogroup GUI /// @{ diff --git a/gui/report.cpp b/gui/report.cpp index 589be43cd..664b59ccf 100644 --- a/gui/report.cpp +++ b/gui/report.cpp @@ -19,7 +19,6 @@ #include #include #include -#include "erroritem.h" #include "report.h" Report::Report(const QString &filename, QObject * parent) : diff --git a/gui/report.h b/gui/report.h index 287ae8cc1..28dfa0aac 100644 --- a/gui/report.h +++ b/gui/report.h @@ -21,7 +21,6 @@ #include #include -#include #include #include "erroritem.h" diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 3048ea26e..3a447c9cb 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -37,13 +36,11 @@ #include #include #include -#include +#include "common.h" #include "erroritem.h" -#include "settings.h" #include "applicationlist.h" #include "resultstree.h" #include "report.h" -#include "xmlreport.h" #include "application.h" #include "showtypes.h" diff --git a/gui/resultstree.h b/gui/resultstree.h index e029aec1e..6950cbf6b 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -25,12 +25,10 @@ #include #include #include -#include -#include "common.h" -#include "applicationlist.h" #include "errorlogger.h" // Severity #include "showtypes.h" +class ApplicationList; class Report; class ErrorItem; class ErrorLine; diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 7a52ba192..7e576dd23 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -#include -#include #include #include #include @@ -28,7 +26,6 @@ #include "common.h" #include "erroritem.h" #include "resultsview.h" -#include "resultstree.h" #include "report.h" #include "txtreport.h" #include "xmlreport.h" diff --git a/gui/resultsview.h b/gui/resultsview.h index f243f5aaa..e927dc047 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -22,8 +22,6 @@ #include -#include "errorlogger.h" -#include "common.h" #include "report.h" #include "showtypes.h" #include "ui_resultsview.h" diff --git a/gui/selectfilesdialog.cpp b/gui/selectfilesdialog.cpp index e1f3226ef..5323a3f48 100644 --- a/gui/selectfilesdialog.cpp +++ b/gui/selectfilesdialog.cpp @@ -20,8 +20,6 @@ #include "ui_selectfilesdialog.h" #include "filelist.h" -#include -#include #include #include #include diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 23bb29d58..80a1e47e8 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -19,11 +19,8 @@ #include #include -#include #include -#include #include -#include #include #include #include diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index fdfcfec63..acbed88ac 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -21,7 +21,6 @@ #define SETTINGSDIALOG_H #include -#include #include "ui_settings.h" class QSettings; diff --git a/gui/statsdialog.cpp b/gui/statsdialog.cpp index 03696da77..0f7f8d1ad 100644 --- a/gui/statsdialog.cpp +++ b/gui/statsdialog.cpp @@ -21,7 +21,6 @@ #include #include #include -#include "common.h" #include "project.h" #include "projectfile.h" #include "statsdialog.h" diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 3067b25c1..cf56eb717 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -20,7 +20,9 @@ #include #include #include +#include "common.h" #include "settings.h" +#include "checkthread.h" #include "threadhandler.h" #include "resultsview.h" diff --git a/gui/threadhandler.h b/gui/threadhandler.h index f11c31cb3..646a38cef 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -24,11 +24,12 @@ #include #include #include -#include "settings.h" -#include "cppcheck.h" #include "threadresult.h" -#include "checkthread.h" -#include "resultsview.h" + +class ResultsView; +class CheckThread; +class QSettings; +class Settings; /// @addtogroup GUI /// @{ diff --git a/gui/threadresult.h b/gui/threadresult.h index 44a8fa18d..945d258da 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -23,7 +23,6 @@ #include #include #include -#include #include "errorlogger.h" class ErrorItem; diff --git a/gui/txtreport.cpp b/gui/txtreport.cpp index 15277949b..f3df77aa4 100644 --- a/gui/txtreport.cpp +++ b/gui/txtreport.cpp @@ -17,8 +17,6 @@ */ #include -#include -#include #include "txtreport.h" TxtReport::TxtReport(const QString &filename, QObject * parent) : diff --git a/gui/txtreport.h b/gui/txtreport.h index 75473b0d5..2310999da 100644 --- a/gui/txtreport.h +++ b/gui/txtreport.h @@ -21,8 +21,6 @@ #include #include -#include -#include #include #include "report.h" diff --git a/gui/xmlreportv1.cpp b/gui/xmlreportv1.cpp index a86e9226c..f73cceb57 100644 --- a/gui/xmlreportv1.cpp +++ b/gui/xmlreportv1.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include "report.h" diff --git a/gui/xmlreportv1.h b/gui/xmlreportv1.h index 6a1b71816..59fd4a7f6 100644 --- a/gui/xmlreportv1.h +++ b/gui/xmlreportv1.h @@ -21,8 +21,6 @@ #include #include -#include -#include #include #include #include "xmlreport.h" diff --git a/gui/xmlreportv2.cpp b/gui/xmlreportv2.cpp index 51f6383e6..cc38c2fc9 100644 --- a/gui/xmlreportv2.cpp +++ b/gui/xmlreportv2.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include "report.h" diff --git a/gui/xmlreportv2.h b/gui/xmlreportv2.h index 522661e61..2405d3aca 100644 --- a/gui/xmlreportv2.h +++ b/gui/xmlreportv2.h @@ -21,11 +21,8 @@ #include #include -#include -#include #include #include -#include "report.h" #include "xmlreport.h" /// @addtogroup GUI