From 026aad2c04d2eb0d93dee8f3a5ce1a7dacab50b7 Mon Sep 17 00:00:00 2001 From: an0n666 <47396879+an0n666@users.noreply.github.com> Date: Sun, 5 Apr 2020 15:12:50 +0600 Subject: [PATCH] Remove deprecated strict super seeding mode from advanced settings --- src/base/bittorrent/session.cpp | 16 ---------------- src/base/bittorrent/session.h | 3 --- src/gui/advancedsettings.cpp | 7 ------- src/gui/advancedsettings.h | 2 +- src/webui/api/appcontroller.cpp | 5 ----- src/webui/webapplication.h | 2 +- src/webui/www/private/views/preferences.html | 10 ---------- 7 files changed, 2 insertions(+), 43 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 3b31b97e0..f9232a6d5 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -468,7 +468,6 @@ Session::Session(QObject *parent) , m_includeOverheadInLimits(BITTORRENT_SESSION_KEY("IncludeOverheadInLimits"), false) , m_announceIP(BITTORRENT_SESSION_KEY("AnnounceIP")) , m_stopTrackerTimeout(BITTORRENT_SESSION_KEY("StopTrackerTimeout"), 1) - , m_isSuperSeedingEnabled(BITTORRENT_SESSION_KEY("SuperSeedingEnabled"), false) , m_maxConnections(BITTORRENT_SESSION_KEY("MaxConnections"), 500, lowerLimited(0, -1)) , m_maxUploads(BITTORRENT_SESSION_KEY("MaxUploads"), -1, lowerLimited(0, -1)) , m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY("MaxConnectionsPerTorrent"), 100, lowerLimited(0, -1)) @@ -1439,8 +1438,6 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack) settingsPack.set_str(lt::settings_pack::announce_ip, announceIP().toStdString()); // Stop tracker timeout settingsPack.set_int(lt::settings_pack::stop_tracker_timeout, stopTrackerTimeout()); - // Super seeding - settingsPack.set_bool(lt::settings_pack::strict_super_seeding, isSuperSeedingEnabled()); // * Max connections limit settingsPack.set_int(lt::settings_pack::connections_limit, maxConnections()); // * Global max upload slots @@ -3680,19 +3677,6 @@ void Session::setStopTrackerTimeout(const int value) configureDeferred(); } -bool Session::isSuperSeedingEnabled() const -{ - return m_isSuperSeedingEnabled; -} - -void Session::setSuperSeedingEnabled(const bool enabled) -{ - if (enabled != m_isSuperSeedingEnabled) { - m_isSuperSeedingEnabled = enabled; - configureDeferred(); - } -} - int Session::maxConnections() const { return m_maxConnections; diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index 4f5bcc332..5cde94d10 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -377,8 +377,6 @@ namespace BitTorrent void setAnnounceIP(const QString &ip); int stopTrackerTimeout() const; void setStopTrackerTimeout(int value); - bool isSuperSeedingEnabled() const; - void setSuperSeedingEnabled(bool enabled); int maxConnections() const; void setMaxConnections(int max); int maxConnectionsPerTorrent() const; @@ -657,7 +655,6 @@ namespace BitTorrent CachedSettingValue m_includeOverheadInLimits; CachedSettingValue m_announceIP; CachedSettingValue m_stopTrackerTimeout; - CachedSettingValue m_isSuperSeedingEnabled; CachedSettingValue m_maxConnections; CachedSettingValue m_maxUploads; CachedSettingValue m_maxConnectionsPerTorrent; diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index 08aa5a86a..5aae09d60 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -114,7 +114,6 @@ enum AdvSettingsRows // seeding CHOKING_ALGORITHM, SEED_CHOKING_ALGORITHM, - SUPER_SEEDING, // tracker ANNOUNCE_ALL_TRACKERS, ANNOUNCE_ALL_TIERS, @@ -223,8 +222,6 @@ void AdvancedSettings::saveAdvancedSettings() // Peer resolution pref->resolvePeerCountries(m_checkBoxResolveCountries.isChecked()); pref->resolvePeerHostNames(m_checkBoxResolveHosts.isChecked()); - // Super seeding - session->setSuperSeedingEnabled(m_checkBoxSuperSeeding.isChecked()); // Network interface if (m_comboBoxInterface.currentIndex() == 0) { // All interfaces (default) @@ -516,10 +513,6 @@ void AdvancedSettings::loadAdvancedSettings() // Resolve peer hosts m_checkBoxResolveHosts.setChecked(pref->resolvePeerHostNames()); addRow(RESOLVE_HOSTS, tr("Resolve peer host names"), &m_checkBoxResolveHosts); - // Super seeding - m_checkBoxSuperSeeding.setChecked(session->isSuperSeedingEnabled()); - addRow(SUPER_SEEDING, (tr("Strict super seeding") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#strict_super_seeding", "(?)")) - , &m_checkBoxSuperSeeding); // Network interface m_comboBoxInterface.addItem(tr("Any interface", "i.e. Any network interface")); const QString currentInterface = session->networkInterface(); diff --git a/src/gui/advancedsettings.h b/src/gui/advancedsettings.h index 749fa3b53..0d46635aa 100644 --- a/src/gui/advancedsettings.h +++ b/src/gui/advancedsettings.h @@ -61,7 +61,7 @@ private: m_spinBoxSaveResumeDataInterval, m_spinBoxOutgoingPortsMin, m_spinBoxOutgoingPortsMax, m_spinBoxUPnPLeaseDuration, m_spinBoxListRefresh, m_spinBoxTrackerPort, m_spinBoxCacheTTL, m_spinBoxSendBufferWatermark, m_spinBoxSendBufferLowWatermark, m_spinBoxSendBufferWatermarkFactor, m_spinBoxSocketBacklogSize, m_spinBoxStopTrackerTimeout, m_spinBoxSavePathHistoryLength; - QCheckBox m_checkBoxOsCache, m_checkBoxRecheckCompleted, m_checkBoxResolveCountries, m_checkBoxResolveHosts, m_checkBoxSuperSeeding, + QCheckBox m_checkBoxOsCache, m_checkBoxRecheckCompleted, m_checkBoxResolveCountries, m_checkBoxResolveHosts, m_checkBoxProgramNotifications, m_checkBoxTorrentAddedNotifications, m_checkBoxTrackerFavicon, m_checkBoxTrackerStatus, m_checkBoxConfirmTorrentRecheck, m_checkBoxConfirmRemoveAllTags, m_checkBoxAnnounceAllTrackers, m_checkBoxAnnounceAllTiers, m_checkBoxMultiConnectionsPerIp, m_checkBoxPieceExtentAffinity, m_checkBoxSuggestMode, m_checkBoxCoalesceRW, m_checkBoxSpeedWidgetEnabled; diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index 23495031d..c7136efea 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -309,8 +309,6 @@ void AppController::preferencesAction() data["upload_slots_behavior"] = static_cast(session->chokingAlgorithm()); // Seed choking algorithm data["upload_choking_algorithm"] = static_cast(session->seedChokingAlgorithm()); - // Super seeding - data["enable_super_seeding"] = session->isSuperSeedingEnabled(); // Announce data["announce_to_all_trackers"] = session->announceToAllTrackers(); data["announce_to_all_tiers"] = session->announceToAllTiers(); @@ -739,9 +737,6 @@ void AppController::setPreferencesAction() // Seed choking algorithm if (hasKey("upload_choking_algorithm")) session->setSeedChokingAlgorithm(static_cast(it.value().toInt())); - // Super seeding - if (hasKey("enable_super_seeding")) - session->setSuperSeedingEnabled(it.value().toBool()); // Announce if (hasKey("announce_to_all_trackers")) session->setAnnounceToAllTrackers(it.value().toBool()); diff --git a/src/webui/webapplication.h b/src/webui/webapplication.h index 054c6efe6..2fa213f2f 100644 --- a/src/webui/webapplication.h +++ b/src/webui/webapplication.h @@ -43,7 +43,7 @@ #include "base/utils/net.h" #include "base/utils/version.h" -constexpr Utils::Version API_VERSION {2, 4, 1}; +constexpr Utils::Version API_VERSION {2, 5, 0}; class APIController; class WebApplication; diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index c2191bd1a..150590f0f 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -1065,14 +1065,6 @@ - - - - - - - - @@ -1789,7 +1781,6 @@ $('embeddedTrackerPort').setProperty('value', pref.embedded_tracker_port); $('uploadSlotsBehavior').setProperty('value', pref.upload_slots_behavior); $('uploadChokingAlgorithm').setProperty('value', pref.upload_choking_algorithm); - $('strictSuperSeeding').setProperty('checked', pref.enable_super_seeding); $('announceAllTrackers').setProperty('checked', pref.announce_to_all_trackers); $('announceAllTiers').setProperty('checked', pref.announce_to_all_tiers); $('announceIP').setProperty('value', pref.announce_ip); @@ -2157,7 +2148,6 @@ settings.set('embedded_tracker_port', $('embeddedTrackerPort').getProperty('value')); settings.set('upload_slots_behavior', $('uploadSlotsBehavior').getProperty('value')); settings.set('upload_choking_algorithm', $('uploadChokingAlgorithm').getProperty('value')); - settings.set('enable_super_seeding', $('strictSuperSeeding').getProperty('checked')); settings.set('announce_to_all_trackers', $('announceAllTrackers').getProperty('checked')); settings.set('announce_to_all_tiers', $('announceAllTiers').getProperty('checked')); settings.set('announce_ip', $('announceIP').getProperty('value'));