|
|
@ -58,7 +58,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> |
|
|
@ -95,7 +97,6 @@ |
|
|
|
#include "statistics.h" |
|
|
|
#include "statistics.h" |
|
|
|
#include "torrentimpl.h" |
|
|
|
#include "torrentimpl.h" |
|
|
|
#include "tracker.h" |
|
|
|
#include "tracker.h" |
|
|
|
#include "trackerentry.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace BitTorrent; |
|
|
|
using namespace BitTorrent; |
|
|
|
|
|
|
|
|
|
|
@ -444,7 +445,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); |
|
|
@ -485,11 +488,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_fileSearcher = new FileSearcher; |
|
|
|
m_fileSearcher = new FileSearcher; |
|
|
|
m_fileSearcher->moveToThread(m_ioThread); |
|
|
|
m_fileSearcher->moveToThread(m_ioThread); |
|
|
@ -2413,6 +2418,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); |
|
|
@ -2433,6 +2439,7 @@ void Session::networkConfigurationChange(const QNetworkConfiguration &cfg) |
|
|
|
configureListeningInterface(); |
|
|
|
configureListeningInterface(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
QStringList Session::getListeningIPs() const |
|
|
|
QStringList Session::getListeningIPs() const |
|
|
|
{ |
|
|
|
{ |
|
|
|