Fix ratio handling

PR #22638.
This commit is contained in:
Vladimir Golovnev 2025-05-01 14:18:18 +03:00 committed by Vladimir Golovnev (Glassez)
commit b3690494ab
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
11 changed files with 19 additions and 24 deletions

View file

@ -1222,7 +1222,7 @@ qreal SessionImpl::globalMaxRatio() const
void SessionImpl::setGlobalMaxRatio(qreal ratio)
{
if (ratio < 0)
ratio = -1.;
ratio = Torrent::NO_RATIO_LIMIT;
if (ratio != globalMaxRatio())
{
@ -2313,7 +2313,7 @@ void SessionImpl::processTorrentShareLimits(TorrentImpl *torrent)
QString description;
if (const qreal ratio = torrent->realRatio();
(ratioLimit >= 0) && (ratio <= Torrent::MAX_RATIO) && (ratio >= ratioLimit))
(ratioLimit >= 0) && (ratio >= ratioLimit))
{
reached = true;
description = tr("Torrent reached the share ratio limit.");