mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Drop QNetworkConfigurationManager usage
This commit is contained in:
parent
102cc684dd
commit
a93391e247
@ -63,7 +63,9 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QNetworkAddressEntry>
|
#include <QNetworkAddressEntry>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QNetworkConfigurationManager>
|
#include <QNetworkConfigurationManager>
|
||||||
|
#endif
|
||||||
#include <QNetworkInterface>
|
#include <QNetworkInterface>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@ -465,7 +467,9 @@ Session::Session(QObject *parent)
|
|||||||
, m_statistics {new Statistics {this}}
|
, m_statistics {new Statistics {this}}
|
||||||
, m_ioThread {new QThread {this}}
|
, m_ioThread {new QThread {this}}
|
||||||
, m_recentErroredTorrentsTimer {new QTimer {this}}
|
, m_recentErroredTorrentsTimer {new QTimer {this}}
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
, m_networkManager {new QNetworkConfigurationManager {this}}
|
, m_networkManager {new QNetworkConfigurationManager {this}}
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (port() < 0)
|
if (port() < 0)
|
||||||
m_port = Utils::Random::rand(1024, 65535);
|
m_port = Utils::Random::rand(1024, 65535);
|
||||||
@ -506,11 +510,13 @@ Session::Session(QObject *parent)
|
|||||||
, &Net::ProxyConfigurationManager::proxyConfigurationChanged
|
, &Net::ProxyConfigurationManager::proxyConfigurationChanged
|
||||||
, this, &Session::configureDeferred);
|
, this, &Session::configureDeferred);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
// Network configuration monitor
|
// Network configuration monitor
|
||||||
connect(m_networkManager, &QNetworkConfigurationManager::onlineStateChanged, this, &Session::networkOnlineStateChanged);
|
connect(m_networkManager, &QNetworkConfigurationManager::onlineStateChanged, this, &Session::networkOnlineStateChanged);
|
||||||
connect(m_networkManager, &QNetworkConfigurationManager::configurationAdded, this, &Session::networkConfigurationChange);
|
connect(m_networkManager, &QNetworkConfigurationManager::configurationAdded, this, &Session::networkConfigurationChange);
|
||||||
connect(m_networkManager, &QNetworkConfigurationManager::configurationRemoved, this, &Session::networkConfigurationChange);
|
connect(m_networkManager, &QNetworkConfigurationManager::configurationRemoved, this, &Session::networkConfigurationChange);
|
||||||
connect(m_networkManager, &QNetworkConfigurationManager::configurationChanged, this, &Session::networkConfigurationChange);
|
connect(m_networkManager, &QNetworkConfigurationManager::configurationChanged, this, &Session::networkConfigurationChange);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_resumeDataSavingManager = new ResumeDataSavingManager {m_resumeFolderPath};
|
m_resumeDataSavingManager = new ResumeDataSavingManager {m_resumeFolderPath};
|
||||||
m_resumeDataSavingManager->moveToThread(m_ioThread);
|
m_resumeDataSavingManager->moveToThread(m_ioThread);
|
||||||
@ -2445,6 +2451,7 @@ void Session::setTempPath(QString path)
|
|||||||
torrent->handleTempPathChanged();
|
torrent->handleTempPathChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void Session::networkOnlineStateChanged(const bool online)
|
void Session::networkOnlineStateChanged(const bool online)
|
||||||
{
|
{
|
||||||
LogMsg(tr("System network status changed to %1", "e.g: System network status changed to ONLINE").arg(online ? tr("ONLINE") : tr("OFFLINE")), Log::INFO);
|
LogMsg(tr("System network status changed to %1", "e.g: System network status changed to ONLINE").arg(online ? tr("ONLINE") : tr("OFFLINE")), Log::INFO);
|
||||||
@ -2465,6 +2472,7 @@ void Session::networkConfigurationChange(const QNetworkConfiguration &cfg)
|
|||||||
configureListeningInterface();
|
configureListeningInterface();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QStringList Session::getListeningIPs() const
|
QStringList Session::getListeningIPs() const
|
||||||
{
|
{
|
||||||
|
@ -53,8 +53,10 @@
|
|||||||
#include "trackerentry.h"
|
#include "trackerentry.h"
|
||||||
|
|
||||||
class QFile;
|
class QFile;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
class QNetworkConfiguration;
|
class QNetworkConfiguration;
|
||||||
class QNetworkConfigurationManager;
|
class QNetworkConfigurationManager;
|
||||||
|
#endif
|
||||||
class QString;
|
class QString;
|
||||||
class QThread;
|
class QThread;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
@ -542,9 +544,11 @@ namespace BitTorrent
|
|||||||
void handleDownloadFinished(const Net::DownloadResult &result);
|
void handleDownloadFinished(const Net::DownloadResult &result);
|
||||||
void fileSearchFinished(const TorrentID &id, const QString &savePath, const QStringList &fileNames);
|
void fileSearchFinished(const TorrentID &id, const QString &savePath, const QStringList &fileNames);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
// Session reconfiguration triggers
|
// Session reconfiguration triggers
|
||||||
void networkOnlineStateChanged(bool online);
|
void networkOnlineStateChanged(bool online);
|
||||||
void networkConfigurationChange(const QNetworkConfiguration &);
|
void networkConfigurationChange(const QNetworkConfiguration &);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct MoveStorageJob
|
struct MoveStorageJob
|
||||||
@ -784,8 +788,9 @@ namespace BitTorrent
|
|||||||
|
|
||||||
SessionStatus m_status;
|
SessionStatus m_status;
|
||||||
CacheStatus m_cacheStatus;
|
CacheStatus m_cacheStatus;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QNetworkConfigurationManager *m_networkManager = nullptr;
|
QNetworkConfigurationManager *m_networkManager = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
QList<MoveStorageJob> m_moveStorageQueue;
|
QList<MoveStorageJob> m_moveStorageQueue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user