diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index feaba7abc..0e1f520af 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -406,8 +406,8 @@ namespace BitTorrent virtual void setMaxConnections(int max) = 0; virtual int maxConnectionsPerTorrent() const = 0; virtual void setMaxConnectionsPerTorrent(int max) = 0; - virtual int maxAltConnectionsPerTorrent() const = 0; - virtual void setMaxAltConnectionsPerTorrent(int max) = 0; + virtual int maxSeedConnectionsPerTorrent() const = 0; + virtual void setMaxSeedConnectionsPerTorrent(int max) = 0; virtual int maxUploads() const = 0; virtual void setMaxUploads(int max) = 0; virtual int maxUploadsPerTorrent() const = 0; diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 610947ee1..357113320 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -495,7 +495,7 @@ SessionImpl::SessionImpl(QObject *parent) , m_maxConnections(BITTORRENT_SESSION_KEY(u"MaxConnections"_s), 500, lowerLimited(0, -1)) , m_maxUploads(BITTORRENT_SESSION_KEY(u"MaxUploads"_s), 20, lowerLimited(0, -1)) , m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerTorrent"_s), 100, lowerLimited(0, -1)) - , m_maxAltConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxAltConnectionsPerTorrent"_s), 40, lowerLimited(0, -1)) + , m_maxSeedConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxSeedConnectionsPerTorrent"_s), 40, lowerLimited(0, -1)) , m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxUploadsPerTorrent"_s), 4, lowerLimited(0, -1)) , m_btProtocol(BITTORRENT_SESSION_KEY(u"BTProtocol"_s), BTProtocol::Both , clampValue(BTProtocol::Both, BTProtocol::UTP)) @@ -4356,9 +4356,9 @@ int SessionImpl::maxConnectionsPerTorrent() const return m_maxConnectionsPerTorrent; } -int SessionImpl::maxAltConnectionsPerTorrent() const +int SessionImpl::maxSeedConnectionsPerTorrent() const { - return m_maxAltConnectionsPerTorrent; + return m_maxSeedConnectionsPerTorrent; } void SessionImpl::setMaxConnectionsPerTorrent(int max) @@ -4372,7 +4372,7 @@ void SessionImpl::setMaxConnectionsPerTorrent(int max) { try { - if (m_maxAltConnectionsPerTorrent == -1 || !torrent->isUploading()) + if (m_maxSeedConnectionsPerTorrent == -1 || !torrent->isUploading()) { torrent->nativeHandle().set_max_connections(max); } @@ -4382,12 +4382,12 @@ void SessionImpl::setMaxConnectionsPerTorrent(int max) } } -void SessionImpl::setMaxAltConnectionsPerTorrent(int max) +void SessionImpl::setMaxSeedConnectionsPerTorrent(int max) { max = (max > 0) ? max : -1; - if (max != maxAltConnectionsPerTorrent()) + if (max != maxSeedConnectionsPerTorrent()) { - m_maxAltConnectionsPerTorrent = max; + m_maxSeedConnectionsPerTorrent = max; for (const TorrentImpl *torrent : asConst(m_torrents)) { diff --git a/src/base/bittorrent/sessionimpl.h b/src/base/bittorrent/sessionimpl.h index a51169cad..7a3d57439 100644 --- a/src/base/bittorrent/sessionimpl.h +++ b/src/base/bittorrent/sessionimpl.h @@ -380,8 +380,8 @@ namespace BitTorrent void setMaxConnections(int max) override; int maxConnectionsPerTorrent() const override; void setMaxConnectionsPerTorrent(int max) override; - int maxAltConnectionsPerTorrent() const override; - void setMaxAltConnectionsPerTorrent(int max) override; + int maxSeedConnectionsPerTorrent() const override; + void setMaxSeedConnectionsPerTorrent(int max) override; int maxUploads() const override; void setMaxUploads(int max) override; int maxUploadsPerTorrent() const override; @@ -701,7 +701,7 @@ namespace BitTorrent CachedSettingValue m_maxConnections; CachedSettingValue m_maxUploads; CachedSettingValue m_maxConnectionsPerTorrent; - CachedSettingValue m_maxAltConnectionsPerTorrent; + CachedSettingValue m_maxSeedConnectionsPerTorrent; CachedSettingValue m_maxUploadsPerTorrent; CachedSettingValue m_btProtocol; CachedSettingValue m_isUTPRateLimited; diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 46820ff6a..17020a996 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -2605,9 +2605,9 @@ void TorrentImpl::updateProgress() void TorrentImpl::updateMaxConnections() { const int maxConnections = m_session->maxConnectionsPerTorrent(); - const int maxAltConnections = m_session->maxAltConnectionsPerTorrent(); - const bool useAltLimit = (maxAltConnections != -1) && isUploading(); - const int max = useAltLimit ? maxAltConnections : maxConnections; + const int maxSeedConnections = m_session->maxSeedConnectionsPerTorrent(); + const bool useAltLimit = (maxSeedConnections != -1) && isUploading(); + const int max = useAltLimit ? maxSeedConnections : maxConnections; if (nativeHandle().max_connections() == max) return; diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp index 26799d0b2..d1dc7ad25 100644 --- a/src/gui/optionsdialog.cpp +++ b/src/gui/optionsdialog.cpp @@ -860,18 +860,18 @@ void OptionsDialog::loadConnectionTabOptions() m_ui->checkMaxConnectionsPerTorrent->setChecked(false); m_ui->spinMaxConnecPerTorrent->setEnabled(false); } - intValue = session->maxAltConnectionsPerTorrent(); + intValue = session->maxSeedConnectionsPerTorrent(); if (intValue > 0) { // enable - m_ui->checkMaxAltConnectionsPerTorrent->setChecked(true); - m_ui->spinMaxAltConnecPerTorrent->setValue(intValue); + m_ui->checkMaxSeedConnectionsPerTorrent->setChecked(true); + m_ui->spinMaxSeedConnecPerTorrent->setValue(intValue); } else { // disable - m_ui->checkMaxAltConnectionsPerTorrent->setChecked(false); - m_ui->spinMaxAltConnecPerTorrent->setEnabled(false); + m_ui->checkMaxSeedConnectionsPerTorrent->setChecked(false); + m_ui->spinMaxSeedConnecPerTorrent->setEnabled(false); } intValue = session->maxUploads(); if (intValue > 0) @@ -951,15 +951,15 @@ void OptionsDialog::loadConnectionTabOptions() connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerTorrent, &QWidget::setEnabled); connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); - connect(m_ui->checkMaxAltConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxAltConnecPerTorrent, &QWidget::setEnabled); - connect(m_ui->checkMaxAltConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); + connect(m_ui->checkMaxSeedConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxSeedConnecPerTorrent, &QWidget::setEnabled); + connect(m_ui->checkMaxSeedConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, m_ui->spinMaxUploads, &QWidget::setEnabled); connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxUploadsPerTorrent, &QWidget::setEnabled); connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxConnec, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); - connect(m_ui->spinMaxAltConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); + connect(m_ui->spinMaxSeedConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxUploads, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxUploadsPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); @@ -1003,7 +1003,7 @@ void OptionsDialog::saveConnectionTabOptions() const session->setMaxConnections(getMaxConnections()); session->setMaxConnectionsPerTorrent(getMaxConnectionsPerTorrent()); - session->setMaxAltConnectionsPerTorrent(getMaxAltConnectionsPerTorrent()); + session->setMaxSeedConnectionsPerTorrent(getMaxSeedConnectionsPerTorrent()); session->setMaxUploads(getMaxUploads()); session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent()); @@ -1631,12 +1631,12 @@ int OptionsDialog::getMaxConnectionsPerTorrent() const return m_ui->spinMaxConnecPerTorrent->value(); } -int OptionsDialog::getMaxAltConnectionsPerTorrent() const +int OptionsDialog::getMaxSeedConnectionsPerTorrent() const { - if (!m_ui->checkMaxAltConnectionsPerTorrent->isChecked()) + if (!m_ui->checkMaxSeedConnectionsPerTorrent->isChecked()) return -1; - return m_ui->spinMaxAltConnecPerTorrent->value(); + return m_ui->spinMaxSeedConnecPerTorrent->value(); } int OptionsDialog::getMaxUploads() const diff --git a/src/gui/optionsdialog.h b/src/gui/optionsdialog.h index 6d2fc3533..27fd8b15c 100644 --- a/src/gui/optionsdialog.h +++ b/src/gui/optionsdialog.h @@ -166,7 +166,7 @@ private: // Bittorrent options int getMaxConnections() const; int getMaxConnectionsPerTorrent() const; - int getMaxAltConnectionsPerTorrent() const; + int getMaxSeedConnectionsPerTorrent() const; int getMaxUploads() const; int getMaxUploadsPerTorrent() const; bool isDHTEnabled() const; diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index 6400ebb14..e9f6bcfaa 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -1933,7 +1933,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - + Maximum number of connections per seeding torrent: @@ -1943,7 +1943,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - + 2