From cc663746eb6ff94bcf09d07fb529e8c8fabc7b81 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 13 Jul 2019 13:03:46 +0800 Subject: [PATCH] Forward declare some classes --- src/gui/cookiesdialog.h | 4 ++-- src/gui/executionlogwidget.h | 3 ++- src/gui/properties/peerlistwidget.h | 10 +++++----- src/gui/properties/propertieswidget.cpp | 1 + src/gui/properties/propertieswidget.h | 7 +++++-- src/gui/properties/proplistdelegate.cpp | 1 + src/gui/properties/speedwidget.cpp | 1 + src/gui/properties/speedwidget.h | 3 +-- src/gui/search/searchjobwidget.h | 4 ++-- src/gui/torrentcontentmodelfolder.cpp | 2 ++ src/gui/torrentcontentmodelitem.cpp | 2 ++ src/gui/torrentcreatordialog.h | 8 ++++---- src/gui/transferlistdelegate.h | 1 - src/gui/transferlistwidget.h | 10 +++++----- 14 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/gui/cookiesdialog.h b/src/gui/cookiesdialog.h index 62558055d..311d488d4 100644 --- a/src/gui/cookiesdialog.h +++ b/src/gui/cookiesdialog.h @@ -31,13 +31,13 @@ #include +class CookiesModel; + namespace Ui { class CookiesDialog; } -class CookiesModel; - class CookiesDialog : public QDialog { Q_OBJECT diff --git a/src/gui/executionlogwidget.h b/src/gui/executionlogwidget.h index 45c7adc7a..8e5953ca8 100644 --- a/src/gui/executionlogwidget.h +++ b/src/gui/executionlogwidget.h @@ -32,11 +32,12 @@ #include #include "base/logger.h" +class LogListWidget; + namespace Ui { class ExecutionLogWidget; } -class LogListWidget; class ExecutionLogWidget : public QWidget { diff --git a/src/gui/properties/peerlistwidget.h b/src/gui/properties/peerlistwidget.h index 6587ec8e3..747b95d22 100644 --- a/src/gui/properties/peerlistwidget.h +++ b/src/gui/properties/peerlistwidget.h @@ -42,11 +42,6 @@ class PeerListDelegate; class PeerListSortModel; class PropertiesWidget; -namespace Net -{ - class ReverseResolution; -} - namespace BitTorrent { class TorrentHandle; @@ -54,6 +49,11 @@ namespace BitTorrent struct PeerAddress; } +namespace Net +{ + class ReverseResolution; +} + class PeerListWidget : public QTreeView { Q_OBJECT diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 144fd92db..e011f3bce 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -44,6 +44,7 @@ #include "base/bittorrent/downloadpriority.h" #include "base/bittorrent/session.h" +#include "base/bittorrent/torrenthandle.h" #include "base/preferences.h" #include "base/unicodestrings.h" #include "base/utils/fs.h" diff --git a/src/gui/properties/propertieswidget.h b/src/gui/properties/propertieswidget.h index 5eb9be6ed..0e59b1124 100644 --- a/src/gui/properties/propertieswidget.h +++ b/src/gui/properties/propertieswidget.h @@ -32,8 +32,6 @@ #include #include -#include "base/bittorrent/torrenthandle.h" - class QPushButton; class QTreeView; @@ -46,6 +44,11 @@ class PropTabBar; class TorrentContentFilterModel; class TrackerListWidget; +namespace BitTorrent +{ + class TorrentHandle; +} + namespace Ui { class PropertiesWidget; diff --git a/src/gui/properties/proplistdelegate.cpp b/src/gui/properties/proplistdelegate.cpp index 75d8e058e..6fb6a5f54 100644 --- a/src/gui/properties/proplistdelegate.cpp +++ b/src/gui/properties/proplistdelegate.cpp @@ -41,6 +41,7 @@ #endif #include "base/bittorrent/downloadpriority.h" +#include "base/bittorrent/torrenthandle.h" #include "base/unicodestrings.h" #include "base/utils/misc.h" #include "base/utils/string.h" diff --git a/src/gui/properties/speedwidget.cpp b/src/gui/properties/speedwidget.cpp index 9b337c3fa..761cb17ee 100644 --- a/src/gui/properties/speedwidget.cpp +++ b/src/gui/properties/speedwidget.cpp @@ -39,6 +39,7 @@ #include "base/bittorrent/sessionstatus.h" #include "base/preferences.h" #include "propertieswidget.h" +#include "speedplotview.h" ComboBoxMenuButton::ComboBoxMenuButton(QWidget *parent, QMenu *menu) : QComboBox(parent) diff --git a/src/gui/properties/speedwidget.h b/src/gui/properties/speedwidget.h index d8a9870ed..cbde6ab60 100644 --- a/src/gui/properties/speedwidget.h +++ b/src/gui/properties/speedwidget.h @@ -32,14 +32,13 @@ #include #include -#include "speedplotview.h" - class QHBoxLayout; class QLabel; class QMenu; class QVBoxLayout; class PropertiesWidget; +class SpeedPlotView; class ComboBoxMenuButton : public QComboBox { diff --git a/src/gui/search/searchjobwidget.h b/src/gui/search/searchjobwidget.h index 0f3853db3..9f1fbb83a 100644 --- a/src/gui/search/searchjobwidget.h +++ b/src/gui/search/searchjobwidget.h @@ -38,14 +38,14 @@ class QHeaderView; class QModelIndex; class QStandardItemModel; -template class CachedSettingValue; - class LineEdit; class SearchHandler; class SearchListDelegate; class SearchSortModel; struct SearchResult; +template class CachedSettingValue; + namespace Ui { class SearchJobWidget; diff --git a/src/gui/torrentcontentmodelfolder.cpp b/src/gui/torrentcontentmodelfolder.cpp index 75870a5ce..89c9147c3 100644 --- a/src/gui/torrentcontentmodelfolder.cpp +++ b/src/gui/torrentcontentmodelfolder.cpp @@ -28,6 +28,8 @@ #include "torrentcontentmodelfolder.h" +#include + #include "base/bittorrent/torrenthandle.h" #include "base/global.h" diff --git a/src/gui/torrentcontentmodelitem.cpp b/src/gui/torrentcontentmodelitem.cpp index bcec140b2..bf136ee83 100644 --- a/src/gui/torrentcontentmodelitem.cpp +++ b/src/gui/torrentcontentmodelitem.cpp @@ -28,6 +28,8 @@ #include "torrentcontentmodelitem.h" +#include + #include "torrentcontentmodelfolder.h" TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder *parent) diff --git a/src/gui/torrentcreatordialog.h b/src/gui/torrentcreatordialog.h index bd94475bf..94e0efdb4 100644 --- a/src/gui/torrentcreatordialog.h +++ b/src/gui/torrentcreatordialog.h @@ -34,14 +34,14 @@ #include "base/settingvalue.h" -namespace Ui +namespace BitTorrent { - class TorrentCreatorDialog; + class TorrentCreatorThread; } -namespace BitTorrent +namespace Ui { - class TorrentCreatorThread; + class TorrentCreatorDialog; } class TorrentCreatorDialog : public QDialog diff --git a/src/gui/transferlistdelegate.h b/src/gui/transferlistdelegate.h index 85587e746..d7db74c7a 100644 --- a/src/gui/transferlistdelegate.h +++ b/src/gui/transferlistdelegate.h @@ -39,7 +39,6 @@ namespace BitTorrent { enum class TorrentState; } -// Defines for download list list columns class TransferListDelegate : public QItemDelegate { diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index ab7ab31c9..49a5e14a3 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -33,16 +33,16 @@ #include #include -namespace BitTorrent -{ - class TorrentHandle; -} - class MainWindow; class TransferListDelegate; class TransferListModel; class TransferListSortModel; +namespace BitTorrent +{ + class TorrentHandle; +} + class TransferListWidget : public QTreeView { Q_OBJECT