Merge pull request #10752 from thalieht/fw-declare

Forward declare and remove some unused #include
This commit is contained in:
Mike Tzou 2019-06-06 10:18:26 +08:00 committed by GitHub
commit c95650c4f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 110 additions and 131 deletions

View File

@ -33,10 +33,11 @@
#include <QVector>
#include "../tristatebool.h"
#include "downloadpriority.h"
namespace BitTorrent
{
enum class DownloadPriority;
struct AddTorrentParams
{
QString name;

View File

@ -28,6 +28,8 @@
#include "peerinfo.h"
#include <QBitArray>
#include "base/bittorrent/torrenthandle.h"
#include "base/net/geoipmanager.h"
#include "base/unicodestrings.h"

View File

@ -31,10 +31,11 @@
#include <libtorrent/peer_info.hpp>
#include <QBitArray>
#include <QCoreApplication>
#include <QHostAddress>
class QBitArray;
namespace BitTorrent
{
class TorrentHandle;

View File

@ -29,7 +29,6 @@
#include "resumedatasavingmanager.h"
#include <QByteArray>
#include <QDebug>
#include <QSaveFile>
#include "base/logger.h"

View File

@ -43,7 +43,6 @@
#include "base/global.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "base/utils/string.h"
namespace

View File

@ -59,6 +59,7 @@
#include "base/profile.h"
#include "base/tristatebool.h"
#include "base/utils/fs.h"
#include "downloadpriority.h"
#include "peerinfo.h"
#include "session.h"
#include "trackerentry.h"

View File

@ -45,7 +45,6 @@
#include <QVector>
#include "private/speedmonitor.h"
#include "downloadpriority.h"
#include "infohash.h"
#include "torrentinfo.h"
@ -58,6 +57,7 @@ class QUrl;
namespace BitTorrent
{
enum class DownloadPriority;
class PeerInfo;
class Session;
class TrackerEntry;

View File

@ -30,7 +30,6 @@
#define BITTORRENT_TRACKERENTRY_H
#include <libtorrent/announce_entry.hpp>
#include <libtorrent/torrent_info.hpp>
class QString;

View File

@ -37,11 +37,9 @@
#endif
#include "base/algorithm.h"
#include "base/bittorrent/magneturi.h"
#include "base/bittorrent/torrentinfo.h"
#include "base/global.h"
#include "base/logger.h"
#include "base/preferences.h"
#include "base/utils/fs.h"
namespace

View File

@ -34,13 +34,12 @@
#include <QElapsedTimer>
#include <QObject>
#include "types.h"
class QTcpSocket;
namespace Http
{
class IRequestHandler;
struct Response;
class Connection : public QObject
{

View File

@ -29,10 +29,12 @@
#ifndef HTTP_IREQUESTHANDLER_H
#define HTTP_IREQUESTHANDLER_H
#include "types.h"
namespace Http
{
struct Environment;
struct Request;
struct Response;
class IRequestHandler
{
public:

View File

@ -31,6 +31,7 @@
#include <QDateTime>
#include "base/http/types.h"
#include "base/utils/gzip.h"
QByteArray Http::toByteArray(Response response)

View File

@ -31,10 +31,13 @@
#ifndef HTTP_RESPONSEGENERATOR_H
#define HTTP_RESPONSEGENERATOR_H
#include "types.h"
class QByteArray;
class QString;
namespace Http
{
struct Response;
QByteArray toByteArray(Response response);
QString httpDate();
void compressContent(Response &response);

View File

@ -32,7 +32,6 @@
#include <QHash>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QObject>
#include <QQueue>
#include <QSet>

View File

@ -30,7 +30,6 @@
#include "geoipmanager.h"
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QHostAddress>

View File

@ -30,7 +30,6 @@
#ifndef NET_GEOIPMANAGER_H
#define NET_GEOIPMANAGER_H
#include <QCache>
#include <QObject>
class QHostAddress;

View File

@ -32,7 +32,6 @@
#include <QHostAddress>
#include <QVariant>
#include "base/types.h"
#include "geoipdatabase.h"
namespace

View File

@ -36,7 +36,6 @@
#include <QAbstractSocket>
#include <QByteArray>
#include <QHash>
#include <QMetaType>
#include <QObject>
#include <QString>

View File

@ -59,7 +59,6 @@
#include "global.h"
#include "settingsstorage.h"
#include "utils/fs.h"
#include "utils/misc.h"
Preferences *Preferences::m_instance = nullptr;

View File

@ -31,13 +31,13 @@
#define PREFERENCES_H
#include <QList>
#include <QStringList>
#include "base/utils/net.h"
class QDateTime;
class QNetworkCookie;
class QSize;
class QStringList;
class QTime;
class QVariant;

View File

@ -35,6 +35,7 @@
#include <QSettings>
class QString;
class Application;
namespace Private

View File

@ -30,7 +30,6 @@
#include <QDataStream>
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>

View File

@ -40,6 +40,7 @@
class QThread;
class QTimer;
class Application;
class AsyncFileStorage;
struct ProcessingJob;

View File

@ -32,7 +32,6 @@
#include <algorithm>
#include <QDebug>
#include <QDir>
#include <QHash>
#include <QJsonArray>
#include <QJsonObject>

View File

@ -35,6 +35,7 @@
class QDateTime;
class QJsonObject;
class QRegularExpression;
class TriStateBool;
namespace RSS

View File

@ -31,14 +31,12 @@
#include "rss_session.h"
#include <QDebug>
#include <QDir>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QSaveFile>
#include <QString>
#include <QThread>
#include <QVariantHash>
#include "../asyncfilestorage.h"
#include "../global.h"

View File

@ -68,6 +68,7 @@
#include <QTimer>
class QThread;
class Application;
class AsyncFileStorage;

View File

@ -33,6 +33,7 @@
#include <QList>
class QStringList;
class FileSystemWatcher;
class ScanFoldersModel : public QAbstractListModel

View File

@ -31,6 +31,7 @@
#include <QObject>
class QProcess;
class SearchPluginManager;
class SearchDownloadHandler : public QObject

View File

@ -31,7 +31,6 @@
#include <memory>
#include <QDebug>
#include <QDir>
#include <QDirIterator>
#include <QDomDocument>

View File

@ -49,7 +49,6 @@
#include <unistd.h>
#endif
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QDirIterator>

View File

@ -37,6 +37,7 @@
#endif
class QString;
enum class ShutdownDialogAction;
/* Miscellaneous functions that can be useful */

View File

@ -37,7 +37,6 @@
#include "bytearray.h"
#include "random.h"
#include "string.h"
namespace Utils
{

View File

@ -31,7 +31,8 @@
#define UTILS_STRING_H
#include <QLatin1String>
#include <QString>
class QString;
class TriStateBool;

View File

@ -43,7 +43,6 @@
#include "base/bittorrent/torrenthandle.h"
#include "base/global.h"
#include "base/net/downloadmanager.h"
#include "base/preferences.h"
#include "base/settingsstorage.h"
#include "base/torrentfileguard.h"
#include "base/utils/fs.h"

View File

@ -30,7 +30,6 @@
#include <limits>
#include <QFont>
#include <QHeaderView>
#include <QHostAddress>
#include <QNetworkInterface>

View File

@ -28,9 +28,6 @@
#include "autoexpandabledialog.h"
#include <QDesktopWidget>
#include "mainwindow.h"
#include "ui_autoexpandabledialog.h"
#include "utils.h"

View File

@ -31,7 +31,8 @@
#include <QDialog>
#include <QLineEdit>
#include <QString>
class QString;
namespace Ui
{

View File

@ -30,15 +30,16 @@
#define CATEGORYFILTERMODEL_H
#include <QAbstractItemModel>
#include <QModelIndex>
class QModelIndex;
class CategoryModelItem;
namespace BitTorrent
{
class TorrentHandle;
}
class CategoryModelItem;
class CategoryFilterModel : public QAbstractItemModel
{
Q_OBJECT

View File

@ -30,7 +30,8 @@
#define CATEGORYFILTERPROXYMODEL_H
#include <QSortFilterProxyModel>
#include <QString>
class QString;
class CategoryFilterProxyModel : public QSortFilterProxyModel
{

View File

@ -29,7 +29,6 @@
#include "categoryfilterwidget.h"
#include <QAction>
#include <QHeaderView>
#include <QMenu>
#include "base/bittorrent/session.h"

View File

@ -28,7 +28,6 @@
#include "executionlogwidget.h"
#include <QColor>
#include <QDateTime>
#include <QPalette>

View File

@ -29,7 +29,6 @@
#ifndef QBT_FSPATHEDIT_H
#define QBT_FSPATHEDIT_H
#include <QScopedPointer>
#include <QWidget>
namespace Private

View File

@ -29,8 +29,11 @@
#include "fspathedit_p.h"
#include <QCompleter>
#include <QContextMenuEvent>
#include <QDir>
#include <QFileInfo>
#include <QFileSystemModel>
#include <QMenu>
#include <QStringList>
#include <QStyle>

View File

@ -29,20 +29,19 @@
#ifndef QBT_GUI_FSPATHEDIT_P_H
#define QBT_GUI_FSPATHEDIT_P_H
#include <QAction>
#include <QComboBox>
#include <QCompleter>
#include <QContextMenuEvent>
#include <QFileIconProvider>
#include <QFileSystemModel>
#include <QKeyEvent>
#include <QLineEdit>
#include <QMenu>
#include <QStringRef>
#include <QValidator>
#include <QVector>
class QAction;
class QCompleter;
class QContextMenuEvent;
class QFileSystemModel;
class QKeyEvent;
class QStringList;
class QStringRef;
namespace Private
{

View File

@ -31,9 +31,7 @@
#include <QHash>
#include <QIcon>
#include <QVector>
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
#include <QDir>
#include <QFile>
#endif

View File

@ -28,7 +28,6 @@
#include "mainwindow.h"
#include <QClipboard>
#include <QCloseEvent>
#include <QDebug>
#include <QDesktopServices>
@ -38,7 +37,6 @@
#include <QMimeData>
#include <QProcess>
#include <QPushButton>
#include <QScrollBar>
#include <QShortcut>
#include <QSplitter>
#include <QStatusBar>
@ -71,7 +69,6 @@
#include "base/utils/password.h"
#include "aboutdialog.h"
#include "addnewtorrentdialog.h"
#include "application.h"
#include "autoexpandabledialog.h"
#include "cookiesdialog.h"
#include "downloadfromurldialog.h"
@ -96,9 +93,6 @@
#include "ui_mainwindow.h"
#include "utils.h"
#ifdef Q_OS_WIN
#include "base/net/downloadmanager.h"
#endif
#ifdef Q_OS_MAC
#include "macutilities.h"
#endif

View File

@ -35,7 +35,6 @@
#include <QCloseEvent>
#include <QDebug>
#include <QDesktopServices>
#include <QDesktopWidget>
#include <QDialogButtonBox>
#include <QEvent>
#include <QFileDialog>
@ -45,7 +44,6 @@
#include "base/bittorrent/session.h"
#include "base/global.h"
#include "base/http/server.h"
#include "base/net/dnsupdater.h"
#include "base/net/portforwarder.h"
#include "base/net/proxyconfigurationmanager.h"

View File

@ -34,6 +34,7 @@
class QAbstractButton;
class QCloseEvent;
class QListWidgetItem;
class AdvancedSettings;
// actions on double-click on torrents

View File

@ -36,7 +36,6 @@
#include <QXmlStreamReader>
#include "base/net/downloadmanager.h"
#include "base/utils/fs.h"
namespace
{

View File

@ -30,7 +30,6 @@
#define PROGRAMUPDATER_H
#include <QObject>
#include <QUrl>
namespace Net
{

View File

@ -31,10 +31,11 @@
#include <QBitArray>
#include <QVector>
#include <QWidget>
#include "piecesbar.h"
class QWidget;
class DownloadedPiecesBar : public PiecesBar
{
using base = PiecesBar;

View File

@ -46,13 +46,11 @@
#include "base/net/geoipmanager.h"
#include "base/net/reverseresolution.h"
#include "base/preferences.h"
#include "base/unicodestrings.h"
#include "guiiconprovider.h"
#include "peerlistdelegate.h"
#include "peerlistsortmodel.h"
#include "peersadditiondialog.h"
#include "propertieswidget.h"
#include "speedlimitdialog.h"
PeerListWidget::PeerListWidget(PropertiesWidget *parent)
: QTreeView(parent)

View File

@ -35,18 +35,18 @@
#include <QShortcut>
#include <QTreeView>
namespace Net
{
class ReverseResolution;
}
class QSortFilterProxyModel;
class QStandardItem;
class QStandardItemModel;
class PeerListDelegate;
class PeerListSortModel;
class PropertiesWidget;
class QSortFilterProxyModel;
class QStandardItem;
class QStandardItemModel;
namespace Net
{
class ReverseResolution;
}
namespace BitTorrent
{

View File

@ -29,6 +29,7 @@
#include "propertieswidget.h"
#include <QAction>
#include <QClipboard>
#include <QDateTime>
#include <QDebug>
#include <QDir>

View File

@ -45,7 +45,6 @@
#include "base/utils/misc.h"
#include "base/utils/string.h"
#include "propertieswidget.h"
#include "torrentcontentmodelitem.h"
namespace
{

View File

@ -35,6 +35,7 @@ class QAbstractItemModel;
class QModelIndex;
class QPainter;
class QStyleOptionViewItem;
class PropertiesWidget;
// Defines for properties list columns

View File

@ -38,6 +38,7 @@ class QHBoxLayout;
class QLabel;
class QMenu;
class QVBoxLayout;
class PropertiesWidget;
class ComboBoxMenuButton : public QComboBox

View File

@ -30,12 +30,14 @@
#include <QAction>
#include <QApplication>
#include <QClipboard>
#include <QColor>
#include <QDebug>
#include <QHash>
#include <QHeaderView>
#include <QMenu>
#include <QMessageBox>
#include <QShortcut>
#include <QStringList>
#include <QTableView>
#include <QTreeWidgetItem>
@ -47,7 +49,6 @@
#include "base/bittorrent/trackerentry.h"
#include "base/global.h"
#include "base/preferences.h"
#include "base/utils/misc.h"
#include "autoexpandabledialog.h"
#include "guiiconprovider.h"
#include "propertieswidget.h"

View File

@ -29,13 +29,13 @@
#ifndef TRACKERLIST_H
#define TRACKERLIST_H
#include <QClipboard>
#include <QList>
#include <QShortcut>
#include <QTreeWidget>
#include "propertieswidget.h"
class QShortcut;
#define NB_STICKY_ITEM 3
namespace BitTorrent

View File

@ -36,8 +36,6 @@
#include "base/bittorrent/trackerentry.h"
#include "base/global.h"
#include "base/net/downloadmanager.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "guiiconprovider.h"
#include "ui_trackersadditiondialog.h"

View File

@ -30,7 +30,6 @@
#include "automatedrssdownloader.h"
#include <QCursor>
#include <QDebug>
#include <QFileDialog>
#include <QMenu>
#include <QMessageBox>

View File

@ -31,13 +31,12 @@
#include "rsswidget.h"
#include <QClipboard>
#include <QDebug>
#include <QDesktopServices>
#include <QDragMoveEvent>
#include <QMenu>
#include <QMessageBox>
#include <QRegularExpression>
#include <QStandardItemModel>
#include <QShortcut>
#include <QString>
#include "base/bittorrent/session.h"

View File

@ -31,13 +31,14 @@
#ifndef RSSWIDGET_H
#define RSSWIDGET_H
#include <QPointer>
#include <QShortcut>
#include <QWidget>
class QListWidgetItem;
class QShortcut;
class QTreeWidgetItem;
class ArticleListWidget;
class FeedListWidget;
class QListWidgetItem;
class QTreeWidgetItem;
namespace Ui
{

View File

@ -36,6 +36,7 @@ class QModelIndex;
class QPainter;
class QStyleOptionViewItem;
class QTreeView;
class PropertiesWidget;
class ScanFoldersDelegate : public QItemDelegate

View File

@ -28,10 +28,8 @@
#include "searchlistdelegate.h"
#include <QCoreApplication>
#include <QModelIndex>
#include <QPainter>
#include <QProgressBar>
#include <QStyleOptionViewItem>
#include "base/utils/misc.h"

View File

@ -29,6 +29,7 @@
#include "searchsortmodel.h"
#include "base/global.h"
#include "base/utils/string.h"
SearchSortModel::SearchSortModel(QObject *parent)
: base(parent)

View File

@ -31,7 +31,6 @@
#include <QSortFilterProxyModel>
#include <QStringList>
#include "base/utils/string.h"
class SearchSortModel : public QSortFilterProxyModel
{

View File

@ -36,30 +36,18 @@
#endif
#include <QDebug>
#include <QHeaderView>
#include <QMessageBox>
#include <QMimeData>
#include <QProcess>
#include <QRegularExpression>
#include <QShortcut>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QTextStream>
#include <QTreeView>
#include "base/bittorrent/session.h"
#include "base/global.h"
#include "base/preferences.h"
#include "base/search/searchpluginmanager.h"
#include "base/search/searchhandler.h"
#include "base/utils/foreignapps.h"
#include "base/utils/fs.h"
#include "addnewtorrentdialog.h"
#include "guiiconprovider.h"
#include "mainwindow.h"
#include "pluginselectdialog.h"
#include "searchlistdelegate.h"
#include "searchsortmodel.h"
#include "searchjobwidget.h"
#include "ui_searchwidget.h"

View File

@ -39,7 +39,6 @@
#include "base/bittorrent/session.h"
#include "base/bittorrent/sessionstatus.h"
#include "base/utils/misc.h"
#include "guiiconprovider.h"
#include "speedlimitdialog.h"
#include "utils.h"

View File

@ -30,17 +30,18 @@
#define TAGFILTERMODEL_H
#include <QAbstractListModel>
#include <QModelIndex>
#include <QSet>
#include <QVector>
class QModelIndex;
class TagModelItem;
namespace BitTorrent
{
class TorrentHandle;
}
class TagModelItem;
class TagFilterModel : public QAbstractListModel
{
Q_OBJECT

View File

@ -30,7 +30,8 @@
#define TAGFILTERPROXYMODEL_H
#include <QSortFilterProxyModel>
#include <QString>
class QString;
class TagFilterProxyModel : public QSortFilterProxyModel
{

View File

@ -29,8 +29,6 @@
#include "tagfilterwidget.h"
#include <QAction>
#include <QDebug>
#include <QHeaderView>
#include <QMenu>
#include <QMessageBox>

View File

@ -49,9 +49,9 @@
#endif
#include "base/bittorrent/downloadpriority.h"
#include "base/bittorrent/torrentinfo.h"
#include "base/global.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "guiiconprovider.h"
#include "torrentcontentmodelfile.h"
#include "torrentcontentmodelfolder.h"

View File

@ -30,16 +30,21 @@
#define TORRENTCONTENTMODEL_H
#include <QAbstractItemModel>
#include <QModelIndex>
#include <QVariant>
#include <QVector>
#include "base/bittorrent/torrentinfo.h"
#include "torrentcontentmodelitem.h"
class QFileIconProvider;
class QModelIndex;
class QVariant;
class TorrentContentModelFile;
namespace BitTorrent
{
class TorrentInfo;
}
class TorrentContentModel : public QAbstractItemModel
{
Q_OBJECT

View File

@ -29,9 +29,13 @@
#ifndef TORRENTCONTENTMODELFILE_H
#define TORRENTCONTENTMODELFILE_H
#include "base/bittorrent/downloadpriority.h"
#include "torrentcontentmodelitem.h"
namespace BitTorrent
{
enum class DownloadPriority;
}
class TorrentContentModelFile : public TorrentContentModelItem
{
public:

View File

@ -29,9 +29,13 @@
#ifndef TORRENTCONTENTMODELFOLDER_H
#define TORRENTCONTENTMODELFOLDER_H
#include "base/bittorrent/downloadpriority.h"
#include "torrentcontentmodelitem.h"
namespace BitTorrent
{
enum class DownloadPriority;
}
class TorrentContentModelFolder : public TorrentContentModelItem
{
public:

View File

@ -28,10 +28,6 @@
#include "torrentcontentmodelitem.h"
#include <QDebug>
#include "base/utils/misc.h"
#include "base/utils/fs.h"
#include "torrentcontentmodelfolder.h"
TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder *parent)

View File

@ -30,10 +30,11 @@
#define TORRENTCONTENTMODELITEM_H
#include <QList>
#include <QVariant>
#include "base/bittorrent/downloadpriority.h"
class QVariant;
class TorrentContentModelFolder;
class TorrentContentModelItem

View File

@ -30,7 +30,6 @@
#include "torrentcreatordialog.h"
#include <QCloseEvent>
#include <QDebug>
#include <QFileDialog>
#include <QMessageBox>
#include <QMimeData>

View File

@ -29,7 +29,6 @@
#include "transferlistfilterswidget.h"
#include <QCheckBox>
#include <QDebug>
#include <QIcon>
#include <QListWidgetItem>
#include <QMenu>
@ -49,12 +48,9 @@
#include "base/torrentfilter.h"
#include "base/utils/fs.h"
#include "base/utils/string.h"
#include "autoexpandabledialog.h"
#include "categoryfilterwidget.h"
#include "guiiconprovider.h"
#include "tagfilterwidget.h"
#include "transferlistdelegate.h"
#include "transferlistmodel.h"
#include "transferlistwidget.h"
#include "utils.h"

View File

@ -34,6 +34,7 @@
class QCheckBox;
class QResizeEvent;
class TransferListWidget;
namespace BitTorrent

View File

@ -38,7 +38,6 @@
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/global.h"
#include "base/torrentfilter.h"
#include "base/utils/fs.h"
static QIcon getIconByState(BitTorrent::TorrentState state);

View File

@ -31,9 +31,10 @@
#include <QMap>
#include <QObject>
#include <QSet>
#include <QString>
#include <QVariant>
class QString;
struct ISessionManager;
using StringMap = QMap<QString, QString>;
using DataMap = QMap<QString, QByteArray>;

View File

@ -28,9 +28,10 @@
#pragma once
#include <QString>
#include <QVariant>
class QString;
struct ISession
{
virtual ~ISession() = default;

View File

@ -28,6 +28,8 @@
#include "searchcontroller.h"
#include <QJsonArray>
#include <QJsonObject>
#include <QSharedPointer>
#include "base/global.h"
@ -37,6 +39,7 @@
#include "base/utils/random.h"
#include "base/utils/string.h"
#include "apierror.h"
#include "isessionmanager.h"
class SearchPluginManager;

View File

@ -29,15 +29,16 @@
#pragma once
#include <QHash>
#include <QJsonArray>
#include <QJsonObject>
#include <QList>
#include <QString>
#include "base/search/searchpluginmanager.h"
#include "apicontroller.h"
#include "isessionmanager.h"
class QJsonArray;
class QJsonObject;
class QStringList;
struct ISession;
struct SearchResult;
class SearchController : public APIController

View File

@ -30,10 +30,8 @@
#include <QDateTime>
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/utils/fs.h"
#include "base/utils/string.h"
namespace
{

View File

@ -40,7 +40,6 @@
#include "base/global.h"
#include "base/net/geoipmanager.h"
#include "base/preferences.h"
#include "base/utils/fs.h"
#include "base/utils/string.h"
#include "apierror.h"
#include "freediskspacechecker.h"