Browse Source

Remove the max half-open connections option from GUI

Its functionality was deprecated long ago.
adaptive-webui-19844
thalieht 6 years ago
parent
commit
4c53447d35
  1. 15
      src/base/bittorrent/session.cpp
  2. 3
      src/base/bittorrent/session.h
  3. 8
      src/gui/advancedsettings.cpp
  4. 2
      src/gui/advancedsettings.h

15
src/base/bittorrent/session.cpp

@ -287,7 +287,6 @@ Session::Session(QObject *parent) @@ -287,7 +287,6 @@ Session::Session(QObject *parent)
, m_announceIP(BITTORRENT_SESSION_KEY("AnnounceIP"))
, m_isSuperSeedingEnabled(BITTORRENT_SESSION_KEY("SuperSeedingEnabled"), false)
, m_maxConnections(BITTORRENT_SESSION_KEY("MaxConnections"), 500, lowerLimited(0, -1))
, m_maxHalfOpenConnections(BITTORRENT_SESSION_KEY("MaxHalfOpenConnections"), 20, lowerLimited(0, -1))
, m_maxUploads(BITTORRENT_SESSION_KEY("MaxUploads"), -1, lowerLimited(0, -1))
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY("MaxConnectionsPerTorrent"), 100, lowerLimited(0, -1))
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY("MaxUploadsPerTorrent"), -1, lowerLimited(0, -1))
@ -3113,20 +3112,6 @@ void Session::setMaxConnections(int max) @@ -3113,20 +3112,6 @@ void Session::setMaxConnections(int max)
}
}
int Session::maxHalfOpenConnections() const
{
return m_maxHalfOpenConnections;
}
void Session::setMaxHalfOpenConnections(int max)
{
max = (max > 0) ? max : -1;
if (max != m_maxHalfOpenConnections) {
m_maxHalfOpenConnections = max;
configureDeferred();
}
}
int Session::maxUploads() const
{
return m_maxUploads;

3
src/base/bittorrent/session.h

@ -413,8 +413,6 @@ namespace BitTorrent @@ -413,8 +413,6 @@ namespace BitTorrent
void setSuperSeedingEnabled(bool enabled);
int maxConnections() const;
void setMaxConnections(int max);
int maxHalfOpenConnections() const;
void setMaxHalfOpenConnections(int max);
int maxConnectionsPerTorrent() const;
void setMaxConnectionsPerTorrent(int max);
int maxUploads() const;
@ -660,7 +658,6 @@ namespace BitTorrent @@ -660,7 +658,6 @@ namespace BitTorrent
CachedSettingValue<QString> m_announceIP;
CachedSettingValue<bool> m_isSuperSeedingEnabled;
CachedSettingValue<int> m_maxConnections;
CachedSettingValue<int> m_maxHalfOpenConnections;
CachedSettingValue<int> m_maxUploads;
CachedSettingValue<int> m_maxConnectionsPerTorrent;
CachedSettingValue<int> m_maxUploadsPerTorrent;

8
src/gui/advancedsettings.cpp

@ -102,7 +102,6 @@ enum AdvSettingsRows @@ -102,7 +102,6 @@ enum AdvSettingsRows
SEND_BUF_LOW_WATERMARK,
SEND_BUF_WATERMARK_FACTOR,
// ports
MAX_HALF_OPEN,
OUTGOING_PORT_MIN,
OUTGOING_PORT_MAX,
UTP_MIX_MODE,
@ -189,8 +188,6 @@ void AdvancedSettings::saveAdvancedSettings() @@ -189,8 +188,6 @@ void AdvancedSettings::saveAdvancedSettings()
// Peer resolution
pref->resolvePeerCountries(checkBoxResolveCountries.isChecked());
pref->resolvePeerHostNames(checkBoxResolveHosts.isChecked());
// Max Half-Open connections
session->setMaxHalfOpenConnections(spinBoxMaxHalfOpen.value());
// Super seeding
session->setSuperSeedingEnabled(checkBoxSuperSeeding.isChecked());
// Network interface
@ -439,11 +436,6 @@ void AdvancedSettings::loadAdvancedSettings() @@ -439,11 +436,6 @@ void AdvancedSettings::loadAdvancedSettings()
// Resolve peer hosts
checkBoxResolveHosts.setChecked(pref->resolvePeerHostNames());
addRow(RESOLVE_HOSTS, tr("Resolve peer host names"), &checkBoxResolveHosts);
// Max Half Open connections
spinBoxMaxHalfOpen.setMinimum(0);
spinBoxMaxHalfOpen.setMaximum(99999);
spinBoxMaxHalfOpen.setValue(session->maxHalfOpenConnections());
addRow(MAX_HALF_OPEN, tr("Maximum number of half-open connections [0: Unlimited]"), &spinBoxMaxHalfOpen);
// Super seeding
checkBoxSuperSeeding.setChecked(session->isSuperSeedingEnabled());
addRow(SUPER_SEEDING, (tr("Strict super seeding") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#strict_super_seeding", "(?)"))

2
src/gui/advancedsettings.h

@ -59,7 +59,7 @@ private: @@ -59,7 +59,7 @@ private:
template <typename T> void addRow(int row, const QString &text, T *widget);
QLabel labelQbtLink, labelLibtorrentLink;
QSpinBox spinBoxAsyncIOThreads, spinBoxCheckingMemUsage, spinBoxCache, spinBoxSaveResumeDataInterval, spinBoxOutgoingPortsMin, spinBoxOutgoingPortsMax, spinBoxListRefresh, spinBoxMaxHalfOpen,
QSpinBox spinBoxAsyncIOThreads, spinBoxCheckingMemUsage, spinBoxCache, spinBoxSaveResumeDataInterval, spinBoxOutgoingPortsMin, spinBoxOutgoingPortsMax, spinBoxListRefresh,
spinBoxTrackerPort, spinBoxCacheTTL, spinBoxSendBufferWatermark, spinBoxSendBufferLowWatermark,
spinBoxSendBufferWatermarkFactor, spinBoxSavePathHistoryLength;
QCheckBox checkBoxOsCache, checkBoxRecheckCompleted, checkBoxResolveCountries, checkBoxResolveHosts, checkBoxSuperSeeding,

Loading…
Cancel
Save