mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 18:56:08 +03:00
Decouple dependency between Session and BandwidthScheduler during Session init. Closes #6007.
This commit is contained in:
parent
668c8cb0e2
commit
106dcfd00e
1 changed files with 6 additions and 4 deletions
|
@ -412,9 +412,6 @@ Session::Session(QObject *parent)
|
||||||
|
|
||||||
connect(Net::ProxyConfigurationManager::instance(), SIGNAL(proxyConfigurationChanged()), SLOT(configureDeferred()));
|
connect(Net::ProxyConfigurationManager::instance(), SIGNAL(proxyConfigurationChanged()), SLOT(configureDeferred()));
|
||||||
|
|
||||||
if (isBandwidthSchedulerEnabled())
|
|
||||||
enableBandwidthScheduler();
|
|
||||||
|
|
||||||
// Network configuration monitor
|
// Network configuration monitor
|
||||||
connect(&m_networkManager, SIGNAL(onlineStateChanged(bool)), SLOT(networkOnlineStateChanged(bool)));
|
connect(&m_networkManager, SIGNAL(onlineStateChanged(bool)), SLOT(networkOnlineStateChanged(bool)));
|
||||||
connect(&m_networkManager, SIGNAL(configurationAdded(const QNetworkConfiguration&)), SLOT(networkConfigurationChange(const QNetworkConfiguration&)));
|
connect(&m_networkManager, SIGNAL(configurationAdded(const QNetworkConfiguration&)), SLOT(networkConfigurationChange(const QNetworkConfiguration&)));
|
||||||
|
@ -836,8 +833,13 @@ Session::~Session()
|
||||||
|
|
||||||
void Session::initInstance()
|
void Session::initInstance()
|
||||||
{
|
{
|
||||||
if (!m_instance)
|
if (!m_instance) {
|
||||||
m_instance = new Session;
|
m_instance = new Session;
|
||||||
|
|
||||||
|
// BandwidthScheduler::start() depends on Session being fully constructed
|
||||||
|
if (m_instance->isBandwidthSchedulerEnabled())
|
||||||
|
m_instance->enableBandwidthScheduler();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::freeInstance()
|
void Session::freeInstance()
|
||||||
|
|
Loading…
Reference in a new issue