Browse Source

Merge pull request #13937 from Chocobo1/qt6

Use Qt provided forward declaration header
adaptive-webui-19844
Mike Tzou 4 years ago committed by GitHub
parent
commit
aaeffe3846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/app/filelogger.cpp
  2. 1
      src/app/upgrade.cpp
  3. 2
      src/base/bittorrent/session.h
  4. 2
      src/base/bittorrent/torrenthandle.cpp
  5. 5
      src/base/bittorrent/torrenthandle.h
  6. 1
      src/base/bittorrent/torrentinfo.cpp
  7. 3
      src/base/bittorrent/torrentinfo.h
  8. 3
      src/base/filesystemwatcher.h
  9. 1
      src/base/logger.cpp
  10. 2
      src/base/logger.h
  11. 1
      src/base/preferences.cpp
  12. 5
      src/base/preferences.h
  13. 3
      src/base/scanfoldersmodel.h
  14. 1
      src/base/search/searchhandler.cpp
  15. 2
      src/base/search/searchhandler.h
  16. 2
      src/base/types.h
  17. 1
      src/base/utils/bytearray.cpp
  18. 2
      src/base/utils/bytearray.h
  19. 1
      src/base/utils/misc.cpp
  20. 3
      src/base/utils/net.cpp
  21. 4
      src/base/utils/net.h
  22. 1
      src/base/utils/password.cpp
  23. 1
      src/base/utils/string.cpp
  24. 5
      src/base/utils/string.h
  25. 3
      src/gui/fspathedit_p.h
  26. 1
      src/gui/properties/downloadedpiecesbar.cpp
  27. 2
      src/gui/properties/downloadedpiecesbar.h
  28. 1
      src/gui/properties/trackerlistwidget.cpp
  29. 2
      src/gui/properties/trackerlistwidget.h
  30. 2
      src/gui/properties/trackersadditiondialog.h
  31. 2
      src/gui/search/pluginselectdialog.h
  32. 2
      src/gui/tagfiltermodel.cpp
  33. 3
      src/gui/tagfiltermodel.h
  34. 1
      src/gui/trackerentriesdialog.cpp
  35. 2
      src/gui/trackerentriesdialog.h
  36. 2
      src/webui/api/apicontroller.cpp
  37. 3
      src/webui/api/apicontroller.h
  38. 33
      src/webui/api/logcontroller.cpp
  39. 2
      src/webui/api/logcontroller.h
  40. 1
      src/webui/api/rsscontroller.cpp
  41. 2
      src/webui/api/rsscontroller.h
  42. 2
      src/webui/api/searchcontroller.cpp
  43. 4
      src/webui/api/searchcontroller.h
  44. 2
      src/webui/api/serialize/serialize_torrent.cpp

1
src/app/filelogger.cpp

@ -33,6 +33,7 @@
#include <QDateTime> #include <QDateTime>
#include <QDir> #include <QDir>
#include <QTextStream> #include <QTextStream>
#include <QVector>
#include "base/global.h" #include "base/global.h"
#include "base/logger.h" #include "base/logger.h"

1
src/app/upgrade.cpp

@ -29,6 +29,7 @@
#include "upgrade.h" #include "upgrade.h"
#include <QFile> #include <QFile>
#include <QVector>
#include "base/logger.h" #include "base/logger.h"
#include "base/profile.h" #include "base/profile.h"

2
src/base/bittorrent/session.h

@ -41,6 +41,7 @@
#include <QHash> #include <QHash>
#include <QPointer> #include <QPointer>
#include <QSet> #include <QSet>
#include <QtContainerFwd>
#include <QVector> #include <QVector>
#include "base/settingvalue.h" #include "base/settingvalue.h"
@ -58,7 +59,6 @@ class QFile;
class QNetworkConfiguration; class QNetworkConfiguration;
class QNetworkConfigurationManager; class QNetworkConfigurationManager;
class QString; class QString;
class QStringList;
class QThread; class QThread;
class QTimer; class QTimer;
class QUrl; class QUrl;

2
src/base/bittorrent/torrenthandle.cpp

@ -31,6 +31,8 @@
#include <type_traits> #include <type_traits>
#include <QHash>
namespace BitTorrent namespace BitTorrent
{ {
uint qHash(const TorrentState key, const uint seed) uint qHash(const TorrentState key, const uint seed)

5
src/base/bittorrent/torrenthandle.h

@ -29,15 +29,12 @@
#pragma once #pragma once
#include <QHash>
#include <QMetaType> #include <QMetaType>
#include <QSet>
#include <QString> #include <QString>
#include <QVector> #include <QtContainerFwd>
class QBitArray; class QBitArray;
class QDateTime; class QDateTime;
class QStringList;
class QUrl; class QUrl;
namespace BitTorrent namespace BitTorrent

1
src/base/bittorrent/torrentinfo.cpp

@ -40,6 +40,7 @@
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QUrl> #include <QUrl>
#include <QVector>
#include "base/exceptions.h" #include "base/exceptions.h"
#include "base/global.h" #include "base/global.h"

3
src/base/bittorrent/torrentinfo.h

@ -32,14 +32,13 @@
#include <libtorrent/torrent_info.hpp> #include <libtorrent/torrent_info.hpp>
#include <QCoreApplication> #include <QCoreApplication>
#include <QVector> #include <QtContainerFwd>
#include "base/indexrange.h" #include "base/indexrange.h"
class QByteArray; class QByteArray;
class QDateTime; class QDateTime;
class QString; class QString;
class QStringList;
class QUrl; class QUrl;
namespace BitTorrent namespace BitTorrent

3
src/base/filesystemwatcher.h

@ -32,11 +32,10 @@
#include <QDir> #include <QDir>
#include <QFileSystemWatcher> #include <QFileSystemWatcher>
#include <QHash> #include <QHash>
#include <QtContainerFwd>
#include <QTimer> #include <QTimer>
#include <QVector> #include <QVector>
class QStringList;
/* /*
* Subclassing QFileSystemWatcher in order to support Network File * Subclassing QFileSystemWatcher in order to support Network File
* System watching (NFS, CIFS) on Linux and Mac OS. * System watching (NFS, CIFS) on Linux and Mac OS.

1
src/base/logger.cpp

@ -31,6 +31,7 @@
#include <algorithm> #include <algorithm>
#include <QDateTime> #include <QDateTime>
#include <QVector>
namespace namespace
{ {

2
src/base/logger.h

@ -34,7 +34,7 @@
#include <QObject> #include <QObject>
#include <QReadWriteLock> #include <QReadWriteLock>
#include <QString> #include <QString>
#include <QVector> #include <QtContainerFwd>
const int MAX_LOG_MESSAGES = 20000; const int MAX_LOG_MESSAGES = 20000;

1
src/base/preferences.cpp

@ -41,6 +41,7 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QDateTime> #include <QDateTime>
#include <QDir> #include <QDir>
#include <QList>
#include <QLocale> #include <QLocale>
#include <QNetworkCookie> #include <QNetworkCookie>
#include <QSettings> #include <QSettings>

5
src/base/preferences.h

@ -30,16 +30,15 @@
#ifndef PREFERENCES_H #ifndef PREFERENCES_H
#define PREFERENCES_H #define PREFERENCES_H
#include <QList> #include <QtContainerFwd>
#include <QVariant>
#include "base/utils/net.h" #include "base/utils/net.h"
class QDateTime; class QDateTime;
class QNetworkCookie; class QNetworkCookie;
class QSize; class QSize;
class QStringList;
class QTime; class QTime;
class QVariant;
enum SchedulerDays enum SchedulerDays
{ {

3
src/base/scanfoldersmodel.h

@ -31,8 +31,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QList> #include <QList>
#include <QtContainerFwd>
class QStringList;
class FileSystemWatcher; class FileSystemWatcher;

1
src/base/search/searchhandler.cpp

@ -31,6 +31,7 @@
#include <QProcess> #include <QProcess>
#include <QTimer> #include <QTimer>
#include <QVector>
#include "base/global.h" #include "base/global.h"
#include "base/utils/foreignapps.h" #include "base/utils/foreignapps.h"

2
src/base/search/searchhandler.h

@ -33,7 +33,7 @@
#include <QList> #include <QList>
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QVector> #include <QtContainerFwd>
class QProcess; class QProcess;
class QTimer; class QTimer;

2
src/base/types.h

@ -29,7 +29,7 @@
#ifndef TYPES_H #ifndef TYPES_H
#define TYPES_H #define TYPES_H
#include <QMap> #include <QtContainerFwd>
const qlonglong MAX_ETA = 8640000; const qlonglong MAX_ETA = 8640000;

1
src/base/utils/bytearray.cpp

@ -29,6 +29,7 @@
#include "bytearray.h" #include "bytearray.h"
#include <QByteArray> #include <QByteArray>
#include <QVector>
QVector<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior) QVector<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior)
{ {

2
src/base/utils/bytearray.h

@ -29,7 +29,7 @@
#pragma once #pragma once
#include <QString> #include <QString>
#include <QVector> #include <QtContainerFwd>
class QByteArray; class QByteArray;

1
src/base/utils/misc.cpp

@ -52,6 +52,7 @@
#include <QRegularExpression> #include <QRegularExpression>
#include <QSet> #include <QSet>
#include <QSysInfo> #include <QSysInfo>
#include <QVector>
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB) #if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
#include <QDBusInterface> #include <QDBusInterface>

3
src/base/utils/net.cpp

@ -28,10 +28,13 @@
#include "net.h" #include "net.h"
#include <QList>
#include <QNetworkInterface> #include <QNetworkInterface>
#include <QPair>
#include <QSslCertificate> #include <QSslCertificate>
#include <QSslKey> #include <QSslKey>
#include <QString> #include <QString>
#include <QVector>
namespace Utils namespace Utils
{ {

4
src/base/utils/net.h

@ -30,9 +30,7 @@
#define BASE_UTILS_NET_H #define BASE_UTILS_NET_H
#include <QHostAddress> #include <QHostAddress>
#include <QList> #include <QtContainerFwd>
#include <QPair>
#include <QVector>
class QSslCertificate; class QSslCertificate;
class QSslKey; class QSslKey;

1
src/base/utils/password.cpp

@ -34,6 +34,7 @@
#include <QByteArray> #include <QByteArray>
#include <QString> #include <QString>
#include <QVector>
#include "bytearray.h" #include "bytearray.h"
#include "random.h" #include "random.h"

1
src/base/utils/string.cpp

@ -35,6 +35,7 @@
#include <QLocale> #include <QLocale>
#include <QRegExp> #include <QRegExp>
#include <QtGlobal> #include <QtGlobal>
#include <QVector>
#if defined(Q_OS_MACOS) || defined(__MINGW32__) #if defined(Q_OS_MACOS) || defined(__MINGW32__)
#define QBT_USES_QTHREADSTORAGE #define QBT_USES_QTHREADSTORAGE

5
src/base/utils/string.h

@ -31,9 +31,10 @@
#define UTILS_STRING_H #define UTILS_STRING_H
#include <QChar> #include <QChar>
#include <QVector> #include <QString>
#include <Qt>
#include <QtContainerFwd>
class QString;
class QStringRef; class QStringRef;
class TriStateBool; class TriStateBool;

3
src/gui/fspathedit_p.h

@ -32,15 +32,14 @@
#include <QComboBox> #include <QComboBox>
#include <QFileIconProvider> #include <QFileIconProvider>
#include <QLineEdit> #include <QLineEdit>
#include <QtContainerFwd>
#include <QValidator> #include <QValidator>
#include <QVector>
class QAction; class QAction;
class QCompleter; class QCompleter;
class QContextMenuEvent; class QContextMenuEvent;
class QFileSystemModel; class QFileSystemModel;
class QKeyEvent; class QKeyEvent;
class QStringList;
class QStringRef; class QStringRef;
namespace Private namespace Private

1
src/gui/properties/downloadedpiecesbar.cpp

@ -31,6 +31,7 @@
#include <cmath> #include <cmath>
#include <QDebug> #include <QDebug>
#include <QVector>
namespace namespace
{ {

2
src/gui/properties/downloadedpiecesbar.h

@ -30,7 +30,7 @@
#define DOWNLOADEDPIECESBAR_H #define DOWNLOADEDPIECESBAR_H
#include <QBitArray> #include <QBitArray>
#include <QVector> #include <QtContainerFwd>
#include "piecesbar.h" #include "piecesbar.h"

1
src/gui/properties/trackerlistwidget.cpp

@ -42,6 +42,7 @@
#include <QTableView> #include <QTableView>
#include <QTreeWidgetItem> #include <QTreeWidgetItem>
#include <QUrl> #include <QUrl>
#include <QVector>
#include "base/bittorrent/peerinfo.h" #include "base/bittorrent/peerinfo.h"
#include "base/bittorrent/session.h" #include "base/bittorrent/session.h"

2
src/gui/properties/trackerlistwidget.h

@ -30,7 +30,7 @@
#define TRACKERLIST_H #define TRACKERLIST_H
#include <QTreeWidget> #include <QTreeWidget>
#include <QVector> #include <QtContainerFwd>
class PropertiesWidget; class PropertiesWidget;

2
src/gui/properties/trackersadditiondialog.h

@ -30,9 +30,9 @@
#define TRACKERSADDITION_H #define TRACKERSADDITION_H
#include <QDialog> #include <QDialog>
#include <QtContainerFwd>
class QString; class QString;
class QStringList;
namespace BitTorrent namespace BitTorrent
{ {

2
src/gui/search/pluginselectdialog.h

@ -31,11 +31,11 @@
#define PLUGINSELECTDIALOG_H #define PLUGINSELECTDIALOG_H
#include <QDialog> #include <QDialog>
#include <QStringList>
#include "base/search/searchpluginmanager.h" #include "base/search/searchpluginmanager.h"
class QDropEvent; class QDropEvent;
class QStringList;
class QTreeWidgetItem; class QTreeWidgetItem;
namespace Net namespace Net

2
src/gui/tagfiltermodel.cpp

@ -30,6 +30,8 @@
#include <QDebug> #include <QDebug>
#include <QIcon> #include <QIcon>
#include <QSet>
#include <QVector>
#include "base/bittorrent/session.h" #include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h" #include "base/bittorrent/torrenthandle.h"

3
src/gui/tagfiltermodel.h

@ -30,8 +30,7 @@
#define TAGFILTERMODEL_H #define TAGFILTERMODEL_H
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QSet> #include <QtContainerFwd>
#include <QVector>
class QModelIndex; class QModelIndex;

1
src/gui/trackerentriesdialog.cpp

@ -31,6 +31,7 @@
#include <algorithm> #include <algorithm>
#include <QHash> #include <QHash>
#include <QVector>
#include "base/bittorrent/trackerentry.h" #include "base/bittorrent/trackerentry.h"
#include "ui_trackerentriesdialog.h" #include "ui_trackerentriesdialog.h"

2
src/gui/trackerentriesdialog.h

@ -29,7 +29,7 @@
#pragma once #pragma once
#include <QDialog> #include <QDialog>
#include <QVector> #include <QtContainerFwd>
#include "base/settingvalue.h" #include "base/settingvalue.h"

2
src/webui/api/apicontroller.cpp

@ -30,8 +30,10 @@
#include <algorithm> #include <algorithm>
#include <QHash>
#include <QJsonDocument> #include <QJsonDocument>
#include <QMetaObject> #include <QMetaObject>
#include <QVector>
#include "apierror.h" #include "apierror.h"

3
src/webui/api/apicontroller.h

@ -28,10 +28,9 @@
#pragma once #pragma once
#include <QHash>
#include <QObject> #include <QObject>
#include <QVariant> #include <QVariant>
#include <QVector> #include <QtContainerFwd>
class QString; class QString;

33
src/webui/api/logcontroller.cpp

@ -30,6 +30,7 @@
#include <QJsonArray> #include <QJsonArray>
#include <QJsonObject> #include <QJsonObject>
#include <QVector>
#include "base/global.h" #include "base/global.h"
#include "base/logger.h" #include "base/logger.h"
@ -75,18 +76,18 @@ void LogController::mainAction()
for (const Log::Msg &msg : asConst(logger->getMessages(lastKnownId))) for (const Log::Msg &msg : asConst(logger->getMessages(lastKnownId)))
{ {
if (!((msg.type == Log::NORMAL && isNormal) if (!(((msg.type == Log::NORMAL) && isNormal)
|| (msg.type == Log::INFO && isInfo) || ((msg.type == Log::INFO) && isInfo)
|| (msg.type == Log::WARNING && isWarning) || ((msg.type == Log::WARNING) && isWarning)
|| (msg.type == Log::CRITICAL && isCritical))) || ((msg.type == Log::CRITICAL) && isCritical)))
continue; continue;
msgList.append(QJsonObject msgList.append(QJsonObject
{ {
{KEY_LOG_ID, msg.id}, {QLatin1String(KEY_LOG_ID), msg.id},
{KEY_LOG_TIMESTAMP, msg.timestamp}, {QLatin1String(KEY_LOG_TIMESTAMP), msg.timestamp},
{KEY_LOG_MSG_TYPE, msg.type}, {QLatin1String(KEY_LOG_MSG_TYPE), msg.type},
{KEY_LOG_MSG_MESSAGE, msg.message} {QLatin1String(KEY_LOG_MSG_MESSAGE), msg.message}
}); });
} }
@ -105,10 +106,8 @@ void LogController::mainAction()
// - last_known_id (int): exclude messages with id <= 'last_known_id' (default -1) // - last_known_id (int): exclude messages with id <= 'last_known_id' (default -1)
void LogController::peersAction() void LogController::peersAction()
{ {
int lastKnownId; bool ok = false;
bool ok; int lastKnownId = params()["last_known_id"].toInt(&ok);
lastKnownId = params()["last_known_id"].toInt(&ok);
if (!ok) if (!ok)
lastKnownId = -1; lastKnownId = -1;
@ -119,11 +118,11 @@ void LogController::peersAction()
{ {
peerList.append(QJsonObject peerList.append(QJsonObject
{ {
{KEY_LOG_ID, peer.id}, {QLatin1String(KEY_LOG_ID), peer.id},
{KEY_LOG_TIMESTAMP, peer.timestamp}, {QLatin1String(KEY_LOG_TIMESTAMP), peer.timestamp},
{KEY_LOG_PEER_IP, peer.ip}, {QLatin1String(KEY_LOG_PEER_IP), peer.ip},
{KEY_LOG_PEER_BLOCKED, peer.blocked}, {QLatin1String(KEY_LOG_PEER_BLOCKED), peer.blocked},
{KEY_LOG_PEER_REASON, peer.reason} {QLatin1String(KEY_LOG_PEER_REASON), peer.reason}
}); });
} }

2
src/webui/api/logcontroller.h

@ -30,7 +30,7 @@
#include "apicontroller.h" #include "apicontroller.h"
class LogController : public APIController class LogController final : public APIController
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(LogController) Q_DISABLE_COPY(LogController)

1
src/webui/api/rsscontroller.cpp

@ -32,6 +32,7 @@
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject> #include <QJsonObject>
#include <QJsonValue> #include <QJsonValue>
#include <QVector>
#include "base/rss/rss_article.h" #include "base/rss/rss_article.h"
#include "base/rss/rss_autodownloader.h" #include "base/rss/rss_autodownloader.h"

2
src/webui/api/rsscontroller.h

@ -30,7 +30,7 @@
#include "apicontroller.h" #include "apicontroller.h"
class RSSController : public APIController class RSSController final : public APIController
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(RSSController) Q_DISABLE_COPY(RSSController)

2
src/webui/api/searchcontroller.cpp

@ -30,8 +30,10 @@
#include <limits> #include <limits>
#include <QHash>
#include <QJsonArray> #include <QJsonArray>
#include <QJsonObject> #include <QJsonObject>
#include <QList>
#include <QSharedPointer> #include <QSharedPointer>
#include "base/global.h" #include "base/global.h"

4
src/webui/api/searchcontroller.h

@ -28,15 +28,13 @@
#pragma once #pragma once
#include <QHash> #include <QtContainerFwd>
#include <QList>
#include "base/search/searchpluginmanager.h" #include "base/search/searchpluginmanager.h"
#include "apicontroller.h" #include "apicontroller.h"
class QJsonArray; class QJsonArray;
class QJsonObject; class QJsonObject;
class QStringList;
struct ISession; struct ISession;
struct SearchResult; struct SearchResult;

2
src/webui/api/serialize/serialize_torrent.cpp

@ -29,6 +29,8 @@
#include "serialize_torrent.h" #include "serialize_torrent.h"
#include <QDateTime> #include <QDateTime>
#include <QSet>
#include <QVector>
#include "base/bittorrent/infohash.h" #include "base/bittorrent/infohash.h"
#include "base/bittorrent/torrenthandle.h" #include "base/bittorrent/torrenthandle.h"

Loading…
Cancel
Save