|
|
@ -263,6 +263,7 @@ Session::Session(QObject *parent) |
|
|
|
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 0) |
|
|
|
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 0) |
|
|
|
, m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60) |
|
|
|
, m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60) |
|
|
|
, m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true) |
|
|
|
, m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true) |
|
|
|
|
|
|
|
, m_guidedReadCacheEnabled(BITTORRENT_SESSION_KEY("GuidedReadCache"), true) |
|
|
|
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY("AnonymousModeEnabled"), false) |
|
|
|
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY("AnonymousModeEnabled"), false) |
|
|
|
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY("QueueingSystemEnabled"), true) |
|
|
|
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY("QueueingSystemEnabled"), true) |
|
|
|
, m_maxActiveDownloads(BITTORRENT_SESSION_KEY("MaxActiveDownloads"), 3, lowerLimited(-1)) |
|
|
|
, m_maxActiveDownloads(BITTORRENT_SESSION_KEY("MaxActiveDownloads"), 3, lowerLimited(-1)) |
|
|
@ -1256,6 +1257,7 @@ void Session::configure(libtorrent::settings_pack &settingsPack) |
|
|
|
: libt::settings_pack::disable_os_cache; |
|
|
|
: libt::settings_pack::disable_os_cache; |
|
|
|
settingsPack.set_int(libt::settings_pack::disk_io_read_mode, mode); |
|
|
|
settingsPack.set_int(libt::settings_pack::disk_io_read_mode, mode); |
|
|
|
settingsPack.set_int(libt::settings_pack::disk_io_write_mode, mode); |
|
|
|
settingsPack.set_int(libt::settings_pack::disk_io_write_mode, mode); |
|
|
|
|
|
|
|
settingsPack.set_bool(libt::settings_pack::guided_read_cache, isGuidedReadCacheEnabled()); |
|
|
|
|
|
|
|
|
|
|
|
settingsPack.set_bool(libt::settings_pack::anonymous_mode, isAnonymousModeEnabled()); |
|
|
|
settingsPack.set_bool(libt::settings_pack::anonymous_mode, isAnonymousModeEnabled()); |
|
|
|
|
|
|
|
|
|
|
@ -1472,6 +1474,7 @@ void Session::configure(libtorrent::session_settings &sessionSettings) |
|
|
|
: libt::session_settings::disable_os_cache; |
|
|
|
: libt::session_settings::disable_os_cache; |
|
|
|
sessionSettings.disk_io_read_mode = mode; |
|
|
|
sessionSettings.disk_io_read_mode = mode; |
|
|
|
sessionSettings.disk_io_write_mode = mode; |
|
|
|
sessionSettings.disk_io_write_mode = mode; |
|
|
|
|
|
|
|
sessionSettings.guided_read_cache = isGuidedReadCacheEnabled(); |
|
|
|
|
|
|
|
|
|
|
|
sessionSettings.anonymous_mode = isAnonymousModeEnabled(); |
|
|
|
sessionSettings.anonymous_mode = isAnonymousModeEnabled(); |
|
|
|
|
|
|
|
|
|
|
@ -2844,6 +2847,19 @@ void Session::setUseOSCache(bool use) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Session::isGuidedReadCacheEnabled() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return m_guidedReadCacheEnabled; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Session::setGuidedReadCacheEnabled(bool enabled) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (enabled == m_guidedReadCacheEnabled) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_guidedReadCacheEnabled = enabled; |
|
|
|
|
|
|
|
configureDeferred(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool Session::isAnonymousModeEnabled() const |
|
|
|
bool Session::isAnonymousModeEnabled() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return m_isAnonymousModeEnabled; |
|
|
|
return m_isAnonymousModeEnabled; |
|
|
|