From 4c53447d3535ba666ff277aa88cec7cdee902f49 Mon Sep 17 00:00:00 2001 From: thalieht Date: Mon, 11 Mar 2019 21:47:49 +0200 Subject: [PATCH] Remove the max half-open connections option from GUI Its functionality was deprecated long ago. --- src/base/bittorrent/session.cpp | 15 --------------- src/base/bittorrent/session.h | 3 --- src/gui/advancedsettings.cpp | 8 -------- src/gui/advancedsettings.h | 2 +- 4 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 1e542ecbf..d02fa3843 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -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) } } -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; diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index dc9103e7d..ce421c593 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -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 CachedSettingValue m_announceIP; CachedSettingValue m_isSuperSeedingEnabled; CachedSettingValue m_maxConnections; - CachedSettingValue m_maxHalfOpenConnections; CachedSettingValue m_maxUploads; CachedSettingValue m_maxConnectionsPerTorrent; CachedSettingValue m_maxUploadsPerTorrent; diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index 786abff17..dd5d5139a 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -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() // 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() // 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", "(?)")) diff --git a/src/gui/advancedsettings.h b/src/gui/advancedsettings.h index 4272e08c3..41d8dfbf0 100644 --- a/src/gui/advancedsettings.h +++ b/src/gui/advancedsettings.h @@ -59,7 +59,7 @@ private: template 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,