Browse Source

Remove deprecated strict super seeding mode from advanced settings

adaptive-webui-19844
an0n666 5 years ago
parent
commit
026aad2c04
  1. 16
      src/base/bittorrent/session.cpp
  2. 3
      src/base/bittorrent/session.h
  3. 7
      src/gui/advancedsettings.cpp
  4. 2
      src/gui/advancedsettings.h
  5. 5
      src/webui/api/appcontroller.cpp
  6. 2
      src/webui/webapplication.h
  7. 10
      src/webui/www/private/views/preferences.html

16
src/base/bittorrent/session.cpp

@ -468,7 +468,6 @@ Session::Session(QObject *parent) @@ -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) @@ -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) @@ -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;

3
src/base/bittorrent/session.h

@ -377,8 +377,6 @@ namespace BitTorrent @@ -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 @@ -657,7 +655,6 @@ namespace BitTorrent
CachedSettingValue<bool> m_includeOverheadInLimits;
CachedSettingValue<QString> m_announceIP;
CachedSettingValue<int> m_stopTrackerTimeout;
CachedSettingValue<bool> m_isSuperSeedingEnabled;
CachedSettingValue<int> m_maxConnections;
CachedSettingValue<int> m_maxUploads;
CachedSettingValue<int> m_maxConnectionsPerTorrent;

7
src/gui/advancedsettings.cpp

@ -114,7 +114,6 @@ enum AdvSettingsRows @@ -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() @@ -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() @@ -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();

2
src/gui/advancedsettings.h

@ -61,7 +61,7 @@ private: @@ -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;

5
src/webui/api/appcontroller.cpp

@ -309,8 +309,6 @@ void AppController::preferencesAction() @@ -309,8 +309,6 @@ void AppController::preferencesAction()
data["upload_slots_behavior"] = static_cast<int>(session->chokingAlgorithm());
// Seed choking algorithm
data["upload_choking_algorithm"] = static_cast<int>(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() @@ -739,9 +737,6 @@ void AppController::setPreferencesAction()
// Seed choking algorithm
if (hasKey("upload_choking_algorithm"))
session->setSeedChokingAlgorithm(static_cast<BitTorrent::SeedChokingAlgorithm>(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());

2
src/webui/webapplication.h

@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
#include "base/utils/net.h"
#include "base/utils/version.h"
constexpr Utils::Version<int, 3, 2> API_VERSION {2, 4, 1};
constexpr Utils::Version<int, 3, 2> API_VERSION {2, 5, 0};
class APIController;
class WebApplication;

10
src/webui/www/private/views/preferences.html

@ -1065,14 +1065,6 @@ @@ -1065,14 +1065,6 @@
</select>
</td>
</tr>
<tr>
<td>
<label for="strictSuperSeeding">QBT_TR(Strict super seeding:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#strict_super_seeding" target="_blank">(?)</a></label>
</td>
<td>
<input type="checkbox" id="strictSuperSeeding" />
</td>
</tr>
<tr>
<td>
<label for="announceAllTrackers">QBT_TR(Always announce to all trackers in a tier:)QBT_TR[CONTEXT=OptionsDialog]</label>
@ -1789,7 +1781,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 @@ @@ -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'));

Loading…
Cancel
Save