From 46bb07d725e22c45ca75ee0dc7485a123cab1c0a Mon Sep 17 00:00:00 2001 From: xarkes Date: Thu, 14 Mar 2019 10:28:42 +0100 Subject: [PATCH] Fixed the way headers are included --- src/CutterApplication.cpp | 9 ++- src/core/MainWindow.cpp | 82 +++++++++++++++------------- src/core/MainWindow.h | 17 +++--- src/dialogs/InitialOptionsDialog.cpp | 4 +- src/widgets/ClassesWidget.cpp | 7 +-- src/widgets/CommentsWidget.cpp | 7 ++- src/widgets/CutterDockWidget.cpp | 2 + src/widgets/ExportsWidget.cpp | 3 +- src/widgets/FlagsWidget.cpp | 9 +-- src/widgets/ImportsWidget.cpp | 9 ++- src/widgets/RegisterRefsWidget.cpp | 2 + src/widgets/RelocsWidget.cpp | 4 +- src/widgets/SearchWidget.cpp | 8 ++- src/widgets/SectionsWidget.cpp | 18 +++--- src/widgets/SegmentsWidget.cpp | 4 +- src/widgets/StringsWidget.cpp | 9 +-- src/widgets/SymbolsWidget.cpp | 3 +- src/widgets/TypesWidget.cpp | 3 +- src/widgets/VisualNavbar.cpp | 6 +- 19 files changed, 109 insertions(+), 97 deletions(-) diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index cb4f8d4d..25b6c1fb 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -4,6 +4,7 @@ #include "common/JupyterConnection.h" #endif #include "plugins/PluginManager.h" +#include "CutterConfig.h" #include #include @@ -18,15 +19,13 @@ #include #include #include - -#include "CutterConfig.h" - -#include - +#include #ifdef Q_OS_WIN #include #endif // Q_OS_WIN +#include + CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv) { // Setup application information diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index e09a0fc4..6eb40b8a 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -1,43 +1,5 @@ -#include "common/PythonManager.h" #include "core/MainWindow.h" #include "ui_MainWindow.h" -#include "common/Helpers.h" -#include "CutterConfig.h" -#include "plugins/PluginManager.h" - -// Qt Headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // Common Headers #include "common/Highlighter.h" @@ -46,6 +8,10 @@ #include "common/SvgIconEngine.h" #include "common/ProgressIndicator.h" #include "common/TempConfig.h" +#include "common/RunScriptTask.h" +#include "common/PythonManager.h" +#include "plugins/PluginManager.h" +#include "CutterConfig.h" // Dialogs #include "dialogs/WelcomeDialog.h" @@ -93,8 +59,46 @@ #include "widgets/MemoryMapWidget.h" #include "widgets/BreakpointWidget.h" #include "widgets/RegisterRefsWidget.h" +#include "widgets/DisassemblyWidget.h" +#include "widgets/StackWidget.h" +#include "widgets/RegistersWidget.h" +#include "widgets/BacktraceWidget.h" +#include "widgets/HexdumpWidget.h" +#include "widgets/PseudocodeWidget.h" -#include "common/RunScriptTask.h" +// Qt Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // Graphics #include diff --git a/src/core/MainWindow.h b/src/core/MainWindow.h index 67c80f2d..a4952a05 100644 --- a/src/core/MainWindow.h +++ b/src/core/MainWindow.h @@ -1,22 +1,14 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include - #include "core/Cutter.h" // only needed for ut64 -#include "widgets/DisassemblyWidget.h" -#include "widgets/GraphWidget.h" -#include "widgets/OverviewWidget.h" -#include "widgets/StackWidget.h" -#include "widgets/RegistersWidget.h" -#include "widgets/BacktraceWidget.h" -#include "widgets/HexdumpWidget.h" -#include "widgets/PseudocodeWidget.h" #include "dialogs/NewFileDialog.h" #include "dialogs/WelcomeDialog.h" #include "common/Configuration.h" #include "common/InitialOptions.h" +#include + #include #include @@ -55,6 +47,11 @@ class SearchWidget; class JupyterWidget; #endif class QDockWidget; +class DisassemblyWidget; +class GraphWidget; +class HexdumpWidget; +class PseudocodeWidget; +class OverviewWidget; namespace Ui { class MainWindow; diff --git a/src/dialogs/InitialOptionsDialog.cpp b/src/dialogs/InitialOptionsDialog.cpp index b763ed98..fe02d213 100644 --- a/src/dialogs/InitialOptionsDialog.cpp +++ b/src/dialogs/InitialOptionsDialog.cpp @@ -1,8 +1,7 @@ - #include "common/AsyncTask.h" - #include "InitialOptionsDialog.h" #include "ui_InitialOptionsDialog.h" + #include "core/MainWindow.h" #include "dialogs/NewFileDialog.h" #include "dialogs/AsyncTaskDialog.h" @@ -11,6 +10,7 @@ #include #include #include +#include InitialOptionsDialog::InitialOptionsDialog(MainWindow *main): QDialog(0), // parent must not be main diff --git a/src/widgets/ClassesWidget.cpp b/src/widgets/ClassesWidget.cpp index be7c0402..cc782286 100644 --- a/src/widgets/ClassesWidget.cpp +++ b/src/widgets/ClassesWidget.cpp @@ -1,15 +1,14 @@ - -#include - #include "ClassesWidget.h" #include "core/MainWindow.h" #include "ui_ClassesWidget.h" #include "common/Helpers.h" +#include "common/SvgIconEngine.h" #include "dialogs/EditMethodDialog.h" #include "dialogs/RenameDialog.h" +#include #include - +#include QVariant ClassesModel::headerData(int section, Qt::Orientation, int role) const { diff --git a/src/widgets/CommentsWidget.cpp b/src/widgets/CommentsWidget.cpp index ab2e001d..a4ef3365 100644 --- a/src/widgets/CommentsWidget.cpp +++ b/src/widgets/CommentsWidget.cpp @@ -1,11 +1,12 @@ -#include -#include - #include "CommentsWidget.h" #include "ui_CommentsWidget.h" #include "core/MainWindow.h" #include "common/Helpers.h" +#include +#include +#include + CommentsModel::CommentsModel(QList *comments, QMap > *nestedComments, QObject *parent) diff --git a/src/widgets/CutterDockWidget.cpp b/src/widgets/CutterDockWidget.cpp index e77a9c7b..80d5d4c6 100644 --- a/src/widgets/CutterDockWidget.cpp +++ b/src/widgets/CutterDockWidget.cpp @@ -1,6 +1,8 @@ #include "CutterDockWidget.h" #include "core/MainWindow.h" +#include +#include CutterDockWidget::CutterDockWidget(MainWindow *parent, QAction *action) : QDockWidget(parent), diff --git a/src/widgets/ExportsWidget.cpp b/src/widgets/ExportsWidget.cpp index 6c023016..af948da8 100644 --- a/src/widgets/ExportsWidget.cpp +++ b/src/widgets/ExportsWidget.cpp @@ -2,9 +2,10 @@ #include "ui_ExportsWidget.h" #include "core/MainWindow.h" #include "common/Helpers.h" - #include "WidgetShortcuts.h" +#include + ExportsModel::ExportsModel(QList *exports, QObject *parent) : QAbstractListModel(parent), exports(exports) diff --git a/src/widgets/FlagsWidget.cpp b/src/widgets/FlagsWidget.cpp index 35d2ff84..8e7a530f 100644 --- a/src/widgets/FlagsWidget.cpp +++ b/src/widgets/FlagsWidget.cpp @@ -1,13 +1,14 @@ -#include -#include -#include - #include "FlagsWidget.h" #include "ui_FlagsWidget.h" #include "core/MainWindow.h" #include "dialogs/RenameDialog.h" #include "common/Helpers.h" +#include +#include +#include +#include + FlagsModel::FlagsModel(QList *flags, QObject *parent) : QAbstractListModel(parent), flags(flags) diff --git a/src/widgets/ImportsWidget.cpp b/src/widgets/ImportsWidget.cpp index bea89396..18d438f8 100644 --- a/src/widgets/ImportsWidget.cpp +++ b/src/widgets/ImportsWidget.cpp @@ -1,14 +1,13 @@ #include "ImportsWidget.h" #include "ui_ImportsWidget.h" - +#include "WidgetShortcuts.h" #include "core/MainWindow.h" #include "common/Helpers.h" -#include "WidgetShortcuts.h" - -#include -#include #include +#include +#include +#include ImportsModel::ImportsModel(QList *imports, QObject *parent) : QAbstractTableModel(parent), diff --git a/src/widgets/RegisterRefsWidget.cpp b/src/widgets/RegisterRefsWidget.cpp index 225d750a..9c3c437d 100644 --- a/src/widgets/RegisterRefsWidget.cpp +++ b/src/widgets/RegisterRefsWidget.cpp @@ -2,8 +2,10 @@ #include "ui_RegisterRefsWidget.h" #include "core/MainWindow.h" #include "common/Helpers.h" + #include #include +#include RegisterRefModel::RegisterRefModel(QList *registerRefs, QObject *parent) : QAbstractListModel(parent), diff --git a/src/widgets/RelocsWidget.cpp b/src/widgets/RelocsWidget.cpp index 097baddb..39b915f8 100644 --- a/src/widgets/RelocsWidget.cpp +++ b/src/widgets/RelocsWidget.cpp @@ -1,9 +1,11 @@ -#include #include "RelocsWidget.h" #include "ui_RelocsWidget.h" #include "core/MainWindow.h" #include "common/Helpers.h" +#include +#include + RelocsModel::RelocsModel(QList *relocs, QObject *parent) : QAbstractTableModel(parent), relocs(relocs) diff --git a/src/widgets/SearchWidget.cpp b/src/widgets/SearchWidget.cpp index 23e0ad47..e88aae8f 100644 --- a/src/widgets/SearchWidget.cpp +++ b/src/widgets/SearchWidget.cpp @@ -1,11 +1,13 @@ -#include -#include -#include #include "SearchWidget.h" #include "ui_SearchWidget.h" #include "core/MainWindow.h" #include "common/Helpers.h" +#include +#include +#include +#include + static const QMap kSearchBoundariesValues { {"io.maps", "All maps"}, {"io.map", "Current map"}, diff --git a/src/widgets/SectionsWidget.cpp b/src/widgets/SectionsWidget.cpp index 5c1c8289..0831d8bc 100644 --- a/src/widgets/SectionsWidget.cpp +++ b/src/widgets/SectionsWidget.cpp @@ -1,18 +1,18 @@ -#include -#include -#include -#include -#include -#include - -#include "common/Configuration.h" #include "SectionsWidget.h" #include "CutterTreeView.h" -#include "core/MainWindow.h" #include "QuickFilterView.h" +#include "core/MainWindow.h" #include "common/Helpers.h" #include "common/Configuration.h" +#include +#include +#include +#include +#include +#include +#include + SectionsModel::SectionsModel(QList *sections, QObject *parent) : QAbstractListModel(parent), sections(sections) diff --git a/src/widgets/SegmentsWidget.cpp b/src/widgets/SegmentsWidget.cpp index 649826b4..b97565af 100644 --- a/src/widgets/SegmentsWidget.cpp +++ b/src/widgets/SegmentsWidget.cpp @@ -1,10 +1,12 @@ #include "SegmentsWidget.h" - #include "CutterTreeView.h" #include "core/MainWindow.h" #include "QuickFilterView.h" #include "common/Helpers.h" +#include +#include + SegmentsModel::SegmentsModel(QList *segments, QObject *parent) : QAbstractListModel(parent), segments(segments) diff --git a/src/widgets/StringsWidget.cpp b/src/widgets/StringsWidget.cpp index 3c32a23c..acbf0e92 100644 --- a/src/widgets/StringsWidget.cpp +++ b/src/widgets/StringsWidget.cpp @@ -1,17 +1,14 @@ - -#include - #include "StringsWidget.h" #include "ui_StringsWidget.h" - #include "core/MainWindow.h" #include "common/Helpers.h" #include "dialogs/XrefsDialog.h" - #include "WidgetShortcuts.h" -#include #include +#include +#include +#include StringsModel::StringsModel(QList *strings, QObject *parent) : QAbstractListModel(parent), diff --git a/src/widgets/SymbolsWidget.cpp b/src/widgets/SymbolsWidget.cpp index b279622b..942068a2 100644 --- a/src/widgets/SymbolsWidget.cpp +++ b/src/widgets/SymbolsWidget.cpp @@ -1,9 +1,10 @@ #include "SymbolsWidget.h" #include "ui_SymbolsWidget.h" - #include "core/MainWindow.h" #include "common/Helpers.h" +#include + SymbolsModel::SymbolsModel(QList *symbols, QObject *parent) : QAbstractListModel(parent), symbols(symbols) diff --git a/src/widgets/TypesWidget.cpp b/src/widgets/TypesWidget.cpp index f4590803..e4d3b980 100644 --- a/src/widgets/TypesWidget.cpp +++ b/src/widgets/TypesWidget.cpp @@ -2,12 +2,13 @@ #include "ui_TypesWidget.h" #include "core/MainWindow.h" #include "common/Helpers.h" - #include "dialogs/LoadNewTypesDialog.h" #include "dialogs/LinkTypeDialog.h" #include #include +#include +#include TypesModel::TypesModel(QList *types, QObject *parent) : QAbstractListModel(parent), diff --git a/src/widgets/VisualNavbar.cpp b/src/widgets/VisualNavbar.cpp index 95f23a27..18541211 100644 --- a/src/widgets/VisualNavbar.cpp +++ b/src/widgets/VisualNavbar.cpp @@ -1,9 +1,7 @@ #include "VisualNavbar.h" - #include "core/MainWindow.h" #include "common/TempConfig.h" -#include #include #include #include @@ -13,6 +11,10 @@ #include #include #include +#include + +#include +#include VisualNavbar::VisualNavbar(MainWindow *main, QWidget *parent) : QToolBar(main),