From 89816f64c28848ef45723de5e0821ea00e130ae4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 26 Jun 2014 14:01:31 -0300 Subject: [PATCH] Headers cleanup. Too much noise on the headers, this commit remove uneeded headers when they are uneeded. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- pref.h | 2 ++ qt-ui/about.h | 1 - qt-ui/divelogexportdialog.h | 2 +- qt-ui/divelogimportdialog.h | 2 +- qt-ui/divepicturewidget.cpp | 9 ++------- qt-ui/divepicturewidget.h | 5 ----- qt-ui/diveplanner.h | 3 --- qt-ui/downloadfromdivecomputer.h | 4 +++- qt-ui/globe.h | 5 ++++- qt-ui/maintab.cpp | 1 - qt-ui/maintab.h | 5 +++-- qt-ui/preferences.h | 1 - qt-ui/printlayout.h | 3 ++- qt-ui/printoptions.h | 2 -- qt-ui/simplewidgets.cpp | 10 ---------- qt-ui/subsurfacewebservices.h | 1 - qt-ui/tagwidget.cpp | 1 + qt-ui/tagwidget.h | 3 ++- units.h | 1 + 19 files changed, 22 insertions(+), 39 deletions(-) diff --git a/pref.h b/pref.h index 6feaa76f3..7345e4eac 100644 --- a/pref.h +++ b/pref.h @@ -5,6 +5,8 @@ extern "C" { #endif +#include "units.h" + /* can't use 'bool' for the boolean values - different size in C and C++ */ typedef struct { diff --git a/qt-ui/about.h b/qt-ui/about.h index 0fa7d6785..47423aea2 100644 --- a/qt-ui/about.h +++ b/qt-ui/about.h @@ -2,7 +2,6 @@ #define ABOUT_H #include -#include #include "ui_about.h" class SubsurfaceAbout : public QDialog { diff --git a/qt-ui/divelogexportdialog.h b/qt-ui/divelogexportdialog.h index 390cd398b..11775053a 100644 --- a/qt-ui/divelogexportdialog.h +++ b/qt-ui/divelogexportdialog.h @@ -2,7 +2,7 @@ #define DIVELOGEXPORTDIALOG_H #include -#include +class QAbstractButton; namespace Ui { class DiveLogExportDialog; diff --git a/qt-ui/divelogimportdialog.h b/qt-ui/divelogimportdialog.h index fb44faa94..a3dc0b26b 100644 --- a/qt-ui/divelogimportdialog.h +++ b/qt-ui/divelogimportdialog.h @@ -2,7 +2,7 @@ #define DIVELOGIMPORTDIALOG_H #include -#include + #include "../dive.h" #include "../divelist.h" diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp index bf76d1144..6849146d5 100644 --- a/qt-ui/divepicturewidget.cpp +++ b/qt-ui/divepicturewidget.cpp @@ -1,12 +1,7 @@ #include "divepicturewidget.h" #include -#include -#include - -void DivePictureDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - QStyledItemDelegate::paint(painter, option, index); -} +#include +#include DivePictureModel *DivePictureModel::instance() { diff --git a/qt-ui/divepicturewidget.h b/qt-ui/divepicturewidget.h index 92df82c5f..fde7c5a9a 100644 --- a/qt-ui/divepicturewidget.h +++ b/qt-ui/divepicturewidget.h @@ -2,7 +2,6 @@ #define DIVEPICTUREWIDGET_H #include -#include #include #include @@ -30,10 +29,6 @@ private: QHash stringPixmapCache; }; -class DivePictureDelegate : QStyledItemDelegate { - virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; -}; - class DivePictureWidget : public QListView { Q_OBJECT public: diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index b80aa98da..378707d96 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -1,11 +1,8 @@ #ifndef DIVEPLANNER_H #define DIVEPLANNER_H -#include #include -#include #include -#include #include "dive.h" diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index 3de102bfd..394766c07 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -5,10 +5,12 @@ #include #include #include -#include + #include "../libdivecomputer.h" #include "ui_downloadfromdivecomputer.h" +class QStringListModel; + class DownloadThread : public QThread { Q_OBJECT public: diff --git a/qt-ui/globe.h b/qt-ui/globe.h index bb8ace47b..8124a4d57 100644 --- a/qt-ui/globe.h +++ b/qt-ui/globe.h @@ -4,10 +4,13 @@ #include #include -#include #include +namespace Marble{ + class GeoDataDocument; +} + class KMessageWidget; using namespace Marble; struct dive; diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 46de9e2a4..c64ef5b14 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -11,7 +11,6 @@ #include "divelistview.h" #include "modeldelegates.h" #include "globe.h" -#include "completionmodels.h" #include "diveplanner.h" #include "divelist.h" #include "qthelper.h" diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index b925c5565..e296f1470 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -11,12 +11,13 @@ #include #include -#include "models.h" #include "ui_maintab.h" #include "completionmodels.h" +#include "dive.h" +class WeightModel; +class CylindersModel; class QCompleter; -struct dive; struct Completers { QCompleter *location; diff --git a/qt-ui/preferences.h b/qt-ui/preferences.h index a32c725e0..eb7066b54 100644 --- a/qt-ui/preferences.h +++ b/qt-ui/preferences.h @@ -2,7 +2,6 @@ #define PREFERENCES_H #include -#include "dive.h" #include "pref.h" #include "ui_preferences.h" diff --git a/qt-ui/printlayout.h b/qt-ui/printlayout.h index e894f3a98..8a907902c 100644 --- a/qt-ui/printlayout.h +++ b/qt-ui/printlayout.h @@ -2,10 +2,11 @@ #define PRINTLAYOUT_H #include -#include #include #include +#include +class QPrinter; class QTableView; class PrintDialog; class TablePrintModel; diff --git a/qt-ui/printoptions.h b/qt-ui/printoptions.h index 72c089e1a..9fc55ed52 100644 --- a/qt-ui/printoptions.h +++ b/qt-ui/printoptions.h @@ -2,8 +2,6 @@ #define PRINTOPTIONS_H #include -#include -#include #include "ui_printoptions.h" diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 89b074ca5..3a9181383 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -1,19 +1,10 @@ #include "simplewidgets.h" #include -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include #include -#include #include #include #include "exif.h" @@ -376,7 +367,6 @@ void DateWidget::mousePressEvent(QMouseEvent *event) calendarWidget->show(); } - void DateWidget::focusInEvent(QFocusEvent *event) { setFocus(); diff --git a/qt-ui/subsurfacewebservices.h b/qt-ui/subsurfacewebservices.h index a9a67de46..b54da67c7 100644 --- a/qt-ui/subsurfacewebservices.h +++ b/qt-ui/subsurfacewebservices.h @@ -10,7 +10,6 @@ #include "ui_webservices.h" class QAbstractButton; -class QNetworkReply; class QHttpMultiPart; class WebServices : public QDialog { diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index d1bb0d711..8201e8e1b 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "mainwindow.h" diff --git a/qt-ui/tagwidget.h b/qt-ui/tagwidget.h index 08984f712..a3f5007fb 100644 --- a/qt-ui/tagwidget.h +++ b/qt-ui/tagwidget.h @@ -2,9 +2,10 @@ #define TAGWIDGET_H #include "groupedlineedit.h" -#include #include +class QCompleter; + class TagWidget : public GroupedLineEdit { Q_OBJECT public: diff --git a/units.h b/units.h index a8c0d7dbc..f3c02121a 100644 --- a/units.h +++ b/units.h @@ -26,6 +26,7 @@ extern "C" { #define SEAWATER_SALINITY 10300 #define FRESHWATER_SALINITY 10000 +#include /* * Some silly typedefs to make our units very explicit. *