mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-12 07:48:04 +00:00
Allow to specify if announcing to all tiers is desired.
This commit is contained in:
parent
2194a05e60
commit
3a5c0d9818
@ -275,6 +275,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_isTrackerFilteringEnabled(BITTORRENT_SESSION_KEY("TrackerFilteringEnabled"), false)
|
, m_isTrackerFilteringEnabled(BITTORRENT_SESSION_KEY("TrackerFilteringEnabled"), false)
|
||||||
, m_IPFilterFile(BITTORRENT_SESSION_KEY("IPFilter"))
|
, m_IPFilterFile(BITTORRENT_SESSION_KEY("IPFilter"))
|
||||||
, m_announceToAllTrackers(BITTORRENT_SESSION_KEY("AnnounceToAllTrackers"), true)
|
, m_announceToAllTrackers(BITTORRENT_SESSION_KEY("AnnounceToAllTrackers"), true)
|
||||||
|
, m_announceToAllTiers(BITTORRENT_SESSION_KEY("AnnounceToAllTiers"), true)
|
||||||
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 64)
|
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 64)
|
||||||
, 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)
|
||||||
@ -1286,9 +1287,8 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
|||||||
}
|
}
|
||||||
settingsPack.set_bool(libt::settings_pack::force_proxy, m_useProxy ? isForceProxyEnabled() : false);
|
settingsPack.set_bool(libt::settings_pack::force_proxy, m_useProxy ? isForceProxyEnabled() : false);
|
||||||
|
|
||||||
const bool announceToAll = announceToAllTrackers();
|
settingsPack.set_bool(libt::settings_pack::announce_to_all_trackers, announceToAllTrackers());
|
||||||
settingsPack.set_bool(libt::settings_pack::announce_to_all_trackers, announceToAll);
|
settingsPack.set_bool(libt::settings_pack::announce_to_all_tiers, announceToAllTiers());
|
||||||
settingsPack.set_bool(libt::settings_pack::announce_to_all_tiers, announceToAll);
|
|
||||||
|
|
||||||
const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1;
|
const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1;
|
||||||
settingsPack.set_int(libt::settings_pack::cache_size, cacheSize);
|
settingsPack.set_int(libt::settings_pack::cache_size, cacheSize);
|
||||||
@ -1569,9 +1569,8 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
|
|||||||
}
|
}
|
||||||
sessionSettings.force_proxy = m_useProxy ? isForceProxyEnabled() : false;
|
sessionSettings.force_proxy = m_useProxy ? isForceProxyEnabled() : false;
|
||||||
|
|
||||||
bool announceToAll = announceToAllTrackers();
|
sessionSettings.announce_to_all_trackers = announceToAllTrackers();
|
||||||
sessionSettings.announce_to_all_trackers = announceToAll;
|
sessionSettings.announce_to_all_tiers = announceToAllTiers();
|
||||||
sessionSettings.announce_to_all_tiers = announceToAll;
|
|
||||||
const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1;
|
const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1;
|
||||||
sessionSettings.cache_size = cacheSize;
|
sessionSettings.cache_size = cacheSize;
|
||||||
sessionSettings.cache_expiry = diskCacheTTL();
|
sessionSettings.cache_expiry = diskCacheTTL();
|
||||||
@ -2968,6 +2967,19 @@ void Session::setAnnounceToAllTrackers(bool val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::announceToAllTiers() const
|
||||||
|
{
|
||||||
|
return m_announceToAllTiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Session::setAnnounceToAllTiers(bool val)
|
||||||
|
{
|
||||||
|
if (val != m_announceToAllTiers) {
|
||||||
|
m_announceToAllTiers = val;
|
||||||
|
configureDeferred();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int Session::diskCacheSize() const
|
int Session::diskCacheSize() const
|
||||||
{
|
{
|
||||||
int size = m_diskCacheSize;
|
int size = m_diskCacheSize;
|
||||||
|
@ -372,6 +372,8 @@ namespace BitTorrent
|
|||||||
void setIPFilterFile(QString path);
|
void setIPFilterFile(QString path);
|
||||||
bool announceToAllTrackers() const;
|
bool announceToAllTrackers() const;
|
||||||
void setAnnounceToAllTrackers(bool val);
|
void setAnnounceToAllTrackers(bool val);
|
||||||
|
bool announceToAllTiers() const;
|
||||||
|
void setAnnounceToAllTiers(bool val);
|
||||||
int diskCacheSize() const;
|
int diskCacheSize() const;
|
||||||
void setDiskCacheSize(int size);
|
void setDiskCacheSize(int size);
|
||||||
int diskCacheTTL() const;
|
int diskCacheTTL() const;
|
||||||
@ -639,6 +641,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<bool> m_isTrackerFilteringEnabled;
|
CachedSettingValue<bool> m_isTrackerFilteringEnabled;
|
||||||
CachedSettingValue<QString> m_IPFilterFile;
|
CachedSettingValue<QString> m_IPFilterFile;
|
||||||
CachedSettingValue<bool> m_announceToAllTrackers;
|
CachedSettingValue<bool> m_announceToAllTrackers;
|
||||||
|
CachedSettingValue<bool> m_announceToAllTiers;
|
||||||
CachedSettingValue<int> m_diskCacheSize;
|
CachedSettingValue<int> m_diskCacheSize;
|
||||||
CachedSettingValue<int> m_diskCacheTTL;
|
CachedSettingValue<int> m_diskCacheTTL;
|
||||||
CachedSettingValue<bool> m_useOSCache;
|
CachedSettingValue<bool> m_useOSCache;
|
||||||
|
@ -99,6 +99,7 @@ enum AdvSettingsRows
|
|||||||
SUPER_SEEDING,
|
SUPER_SEEDING,
|
||||||
// tracker
|
// tracker
|
||||||
ANNOUNCE_ALL_TRACKERS,
|
ANNOUNCE_ALL_TRACKERS,
|
||||||
|
ANNOUNCE_ALL_TIERS,
|
||||||
ANNOUNCE_IP,
|
ANNOUNCE_IP,
|
||||||
|
|
||||||
ROW_COUNT
|
ROW_COUNT
|
||||||
@ -217,6 +218,7 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||||||
pref->setConfirmRemoveAllTags(cb_confirm_remove_all_tags.isChecked());
|
pref->setConfirmRemoveAllTags(cb_confirm_remove_all_tags.isChecked());
|
||||||
|
|
||||||
session->setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
|
session->setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
|
||||||
|
session->setAnnounceToAllTiers(cb_announce_all_tiers.isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvancedSettings::updateCacheSpinSuffix(int value)
|
void AdvancedSettings::updateCacheSpinSuffix(int value)
|
||||||
@ -452,9 +454,13 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||||||
cb_confirm_remove_all_tags.setChecked(pref->confirmRemoveAllTags());
|
cb_confirm_remove_all_tags.setChecked(pref->confirmRemoveAllTags());
|
||||||
addRow(CONFIRM_REMOVE_ALL_TAGS, tr("Confirm removal of all tags"), &cb_confirm_remove_all_tags);
|
addRow(CONFIRM_REMOVE_ALL_TAGS, tr("Confirm removal of all tags"), &cb_confirm_remove_all_tags);
|
||||||
|
|
||||||
// Announce to all trackers
|
// Announce to all trackers in a tier
|
||||||
cb_announce_all_trackers.setChecked(session->announceToAllTrackers());
|
cb_announce_all_trackers.setChecked(session->announceToAllTrackers());
|
||||||
addRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers"), &cb_announce_all_trackers);
|
addRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers in a tier"), &cb_announce_all_trackers);
|
||||||
|
|
||||||
|
// Announce to all tiers
|
||||||
|
cb_announce_all_tiers.setChecked(session->announceToAllTiers());
|
||||||
|
addRow(ANNOUNCE_ALL_TIERS, tr("Always announce to all tiers"), &cb_announce_all_tiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -79,8 +79,8 @@ private:
|
|||||||
spinSendBufferWatermark, spinSendBufferLowWatermark, spinSendBufferWatermarkFactor;
|
spinSendBufferWatermark, spinSendBufferLowWatermark, spinSendBufferWatermarkFactor;
|
||||||
QCheckBox cb_os_cache, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts, cb_super_seeding,
|
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_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, cb_announce_all_tiers,
|
||||||
cbSuggestMode;
|
cbGuidedReadCache, cbMultiConnectionsPerIp, cbSuggestMode;
|
||||||
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode, comboChokingAlgorithm, comboSeedChokingAlgorithm;
|
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode, comboChokingAlgorithm, comboSeedChokingAlgorithm;
|
||||||
QLineEdit txtAnnounceIP;
|
QLineEdit txtAnnounceIP;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user