mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Add suggest_mode knob
This commit is contained in:
parent
6c32f6beff
commit
55a1628a5e
@ -264,6 +264,7 @@ Session::Session(QObject *parent)
|
||||
, m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60)
|
||||
, m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true)
|
||||
, m_guidedReadCacheEnabled(BITTORRENT_SESSION_KEY("GuidedReadCache"), true)
|
||||
, m_isSuggestMode(BITTORRENT_SESSION_KEY("SuggestMode"), false)
|
||||
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY("AnonymousModeEnabled"), false)
|
||||
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY("QueueingSystemEnabled"), true)
|
||||
, m_maxActiveDownloads(BITTORRENT_SESSION_KEY("MaxActiveDownloads"), 3, lowerLimited(-1))
|
||||
@ -1260,6 +1261,7 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
||||
settingsPack.set_int(libt::settings_pack::disk_io_read_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::suggest_mode, isSuggestModeEnabled());
|
||||
|
||||
settingsPack.set_bool(libt::settings_pack::anonymous_mode, isAnonymousModeEnabled());
|
||||
|
||||
@ -1496,6 +1498,7 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
|
||||
sessionSettings.disk_io_read_mode = mode;
|
||||
sessionSettings.disk_io_write_mode = mode;
|
||||
sessionSettings.guided_read_cache = isGuidedReadCacheEnabled();
|
||||
sessionSettings.suggest_mode = isSuggestModeEnabled();
|
||||
|
||||
sessionSettings.anonymous_mode = isAnonymousModeEnabled();
|
||||
|
||||
@ -2926,6 +2929,19 @@ void Session::setGuidedReadCacheEnabled(bool enabled)
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
bool Session::isSuggestModeEnabled() const
|
||||
{
|
||||
return m_isSuggestMode;
|
||||
}
|
||||
|
||||
void Session::setSuggestMode(bool mode)
|
||||
{
|
||||
if (mode == m_isSuggestMode) return;
|
||||
|
||||
m_isSuggestMode = mode;
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
bool Session::isAnonymousModeEnabled() const
|
||||
{
|
||||
return m_isAnonymousModeEnabled;
|
||||
|
@ -339,6 +339,8 @@ namespace BitTorrent
|
||||
void setUseOSCache(bool use);
|
||||
bool isGuidedReadCacheEnabled() const;
|
||||
void setGuidedReadCacheEnabled(bool enabled);
|
||||
bool isSuggestModeEnabled() const;
|
||||
void setSuggestMode(bool mode);
|
||||
bool isAnonymousModeEnabled() const;
|
||||
void setAnonymousModeEnabled(bool enabled);
|
||||
bool isQueueingSystemEnabled() const;
|
||||
@ -586,6 +588,7 @@ namespace BitTorrent
|
||||
CachedSettingValue<int> m_diskCacheTTL;
|
||||
CachedSettingValue<bool> m_useOSCache;
|
||||
CachedSettingValue<bool> m_guidedReadCacheEnabled;
|
||||
CachedSettingValue<bool> m_isSuggestMode;
|
||||
CachedSettingValue<bool> m_isAnonymousModeEnabled;
|
||||
CachedSettingValue<bool> m_isQueueingEnabled;
|
||||
CachedSettingValue<int> m_maxActiveDownloads;
|
||||
|
@ -79,6 +79,7 @@ enum AdvSettingsRows
|
||||
DISK_CACHE_TTL,
|
||||
OS_CACHE,
|
||||
GUIDED_READ_CACHE,
|
||||
SUGGEST_MODE,
|
||||
// ports
|
||||
MAX_HALF_OPEN,
|
||||
OUTGOING_PORT_MIN,
|
||||
@ -134,6 +135,8 @@ void AdvancedSettings::saveAdvancedSettings()
|
||||
session->setUseOSCache(cb_os_cache.isChecked());
|
||||
// Guided read cache
|
||||
session->setGuidedReadCacheEnabled(cbGuidedReadCache.isChecked());
|
||||
// Suggest mode
|
||||
session->setSuggestMode(cbSuggestMode.isChecked());
|
||||
// Save resume data interval
|
||||
session->setSaveResumeDataInterval(spin_save_resume_data_interval.value());
|
||||
// Outgoing ports
|
||||
@ -297,6 +300,9 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
// Guided read cache
|
||||
cbGuidedReadCache.setChecked(session->isGuidedReadCacheEnabled());
|
||||
addRow(GUIDED_READ_CACHE, tr("Guided read cache"), &cbGuidedReadCache);
|
||||
// Suggest mode
|
||||
cbSuggestMode.setChecked(session->isSuggestModeEnabled());
|
||||
addRow(SUGGEST_MODE, tr("Send upload piece suggestions"), &cbSuggestMode);
|
||||
// Save resume data interval
|
||||
spin_save_resume_data_interval.setMinimum(1);
|
||||
spin_save_resume_data_interval.setMaximum(1440);
|
||||
|
@ -78,7 +78,8 @@ private:
|
||||
QSpinBox spin_cache, spin_save_resume_data_interval, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port, spin_cache_ttl;
|
||||
QCheckBox cb_os_cache, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts, cb_super_seeding,
|
||||
cb_program_notifications, cb_torrent_added_notifications, cb_tracker_favicon, cb_tracker_status,
|
||||
cb_confirm_torrent_recheck, cb_confirm_remove_all_tags, cb_listen_ipv6, cb_announce_all_trackers, cbGuidedReadCache, cbMultiConnectionsPerIp;
|
||||
cb_confirm_torrent_recheck, cb_confirm_remove_all_tags, cb_listen_ipv6, cb_announce_all_trackers, cbGuidedReadCache, cbMultiConnectionsPerIp,
|
||||
cbSuggestMode;
|
||||
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode, comboChokingAlgorithm, comboSeedChokingAlgorithm;
|
||||
QLineEdit txtAnnounceIP;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user