mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Allow setting the number of maximum active checking torrents
This is to allow re-checking of multiple torrents simultaneously. This will benefit users who have multiple disks or SSD. Closes #15296. Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
parent
889d994dbc
commit
801cfdbc24
7 changed files with 75 additions and 1 deletions
|
@ -450,6 +450,7 @@ Session::Session(QObject *parent)
|
|||
, m_networkInterfaceName(BITTORRENT_SESSION_KEY("InterfaceName"))
|
||||
, m_networkInterfaceAddress(BITTORRENT_SESSION_KEY("InterfaceAddress"))
|
||||
, m_encryption(BITTORRENT_SESSION_KEY("Encryption"), 0)
|
||||
, m_maxActiveCheckingTorrents(BITTORRENT_SESSION_KEY("MaxActiveCheckingTorrents"), 1)
|
||||
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY("ProxyPeerConnections"), false)
|
||||
, m_chokingAlgorithm(BITTORRENT_SESSION_KEY("ChokingAlgorithm"), ChokingAlgorithm::FixedSlots
|
||||
, clampValue(ChokingAlgorithm::FixedSlots, ChokingAlgorithm::RateBased))
|
||||
|
@ -1287,6 +1288,8 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
|||
settingsPack.set_int(lt::settings_pack::in_enc_policy, lt::settings_pack::pe_disabled);
|
||||
}
|
||||
|
||||
settingsPack.set_int(lt::settings_pack::active_checking, maxActiveCheckingTorrents());
|
||||
|
||||
// proxy
|
||||
const auto proxyManager = Net::ProxyConfigurationManager::instance();
|
||||
const Net::ProxyConfiguration proxyConfig = proxyManager->proxyConfiguration();
|
||||
|
@ -2985,6 +2988,20 @@ void Session::setEncryption(const int state)
|
|||
}
|
||||
}
|
||||
|
||||
int Session::maxActiveCheckingTorrents() const
|
||||
{
|
||||
return m_maxActiveCheckingTorrents;
|
||||
}
|
||||
|
||||
void Session::setMaxActiveCheckingTorrents(const int val)
|
||||
{
|
||||
if (val == m_maxActiveCheckingTorrents)
|
||||
return;
|
||||
|
||||
m_maxActiveCheckingTorrents = val;
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
bool Session::isProxyPeerConnectionsEnabled() const
|
||||
{
|
||||
return m_isProxyPeerConnectionsEnabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue