Raise 'torrent share ratio' maximum limit

The default from Qt was `99.99` which could be too small for some.
The new limit is `INT_MAX` (not `DOUBLE_MAX`) as to hide the rounding/approximation errors from the user.

PR #23559.
This commit is contained in:
Chocobo1
2025-11-30 21:00:16 +08:00
committed by GitHub
parent ed9a8687ad
commit f68bc3fef9
2 changed files with 6 additions and 1 deletions

View File

@@ -1117,6 +1117,8 @@ void OptionsDialog::loadBittorrentTabOptions()
m_ui->spinUploadRateForSlowTorrents->setValue(session->uploadRateForSlowTorrents()); m_ui->spinUploadRateForSlowTorrents->setValue(session->uploadRateForSlowTorrents());
m_ui->spinSlowTorrentsInactivityTimer->setValue(session->slowTorrentsInactivityTimer()); m_ui->spinSlowTorrentsInactivityTimer->setValue(session->slowTorrentsInactivityTimer());
m_ui->spinMaxRatio->setMaximum(std::numeric_limits<int>::max());
if (session->globalMaxRatio() >= 0.) if (session->globalMaxRatio() >= 0.)
{ {
// Enable // Enable
@@ -1161,7 +1163,7 @@ void OptionsDialog::loadBittorrentTabOptions()
const QHash<BitTorrent::ShareLimitAction, int> actIndex = const QHash<BitTorrent::ShareLimitAction, int> actIndex =
{ {
{BitTorrent::ShareLimitAction::Stop, 0}, {BitTorrent::ShareLimitAction::Stop, 0},
{BitTorrent::ShareLimitAction::Remove, 1}, {BitTorrent::ShareLimitAction::Remove, 1},
{BitTorrent::ShareLimitAction::RemoveWithContent, 2}, {BitTorrent::ShareLimitAction::RemoveWithContent, 2},
{BitTorrent::ShareLimitAction::EnableSuperSeeding, 3} {BitTorrent::ShareLimitAction::EnableSuperSeeding, 3}

View File

@@ -28,6 +28,8 @@
#include "torrentsharelimitswidget.h" #include "torrentsharelimitswidget.h"
#include <limits>
#include "base/bittorrent/torrent.h" #include "base/bittorrent/torrent.h"
#include "ui_torrentsharelimitswidget.h" #include "ui_torrentsharelimitswidget.h"
@@ -59,6 +61,7 @@ TorrentShareLimitsWidget::TorrentShareLimitsWidget(QWidget *parent)
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->spinBoxRatioValue->setEnabled(false); m_ui->spinBoxRatioValue->setEnabled(false);
m_ui->spinBoxRatioValue->setMaximum(std::numeric_limits<int>::max());
m_ui->spinBoxRatioValue->setSuffix({}); m_ui->spinBoxRatioValue->setSuffix({});
m_ui->spinBoxRatioValue->clear(); m_ui->spinBoxRatioValue->clear();
m_ui->spinBoxSeedingTimeValue->setEnabled(false); m_ui->spinBoxSeedingTimeValue->setEnabled(false);