Skip to content

Commit 944ec64

Browse files
committed
Allow to set torrent share limits per category
1 parent 93470f2 commit 944ec64

31 files changed

+481
-283
lines changed

src/app/upgrade.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <QCoreApplication>
3333
#include <QMetaEnum>
3434

35-
#include "base/bittorrent/sharelimitaction.h"
35+
#include "base/bittorrent/sharelimits.h"
3636
#include "base/bittorrent/torrentcontentlayout.h"
3737
#include "base/global.h"
3838
#include "base/logger.h"

src/base/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ add_library(qbt_base STATIC
3434
bittorrent/session.h
3535
bittorrent/sessionimpl.h
3636
bittorrent/sessionstatus.h
37-
bittorrent/sharelimitaction.h
37+
bittorrent/sharelimits.h
3838
bittorrent/speedmonitor.h
3939
bittorrent/sslparameters.h
4040
bittorrent/torrent.h

src/base/bittorrent/addtorrentparams.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ BitTorrent::AddTorrentParams BitTorrent::parseAddTorrentParams(const QJsonObject
125125
.useAutoTMM = getOptionalBool(jsonObj, PARAM_AUTOTMM),
126126
.uploadLimit = jsonObj.value(PARAM_UPLOADLIMIT).toInt(-1),
127127
.downloadLimit = jsonObj.value(PARAM_DOWNLOADLIMIT).toInt(-1),
128-
.seedingTimeLimit = jsonObj.value(PARAM_SEEDINGTIMELIMIT).toInt(Torrent::USE_GLOBAL_SEEDING_TIME),
129-
.inactiveSeedingTimeLimit = jsonObj.value(PARAM_INACTIVESEEDINGTIMELIMIT).toInt(Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME),
130-
.ratioLimit = jsonObj.value(PARAM_RATIOLIMIT).toDouble(Torrent::USE_GLOBAL_RATIO),
128+
.seedingTimeLimit = jsonObj.value(PARAM_SEEDINGTIMELIMIT).toInt(DEFAULT_SEEDING_TIME_LIMIT),
129+
.inactiveSeedingTimeLimit = jsonObj.value(PARAM_INACTIVESEEDINGTIMELIMIT).toInt(DEFAULT_SEEDING_TIME_LIMIT),
130+
.ratioLimit = jsonObj.value(PARAM_RATIOLIMIT).toDouble(DEFAULT_RATIO_LIMIT),
131131
.shareLimitAction = getEnum<ShareLimitAction>(jsonObj, PARAM_SHARELIMITACTION, ShareLimitAction::Default),
132132
.sslParameters =
133133
{

src/base/bittorrent/addtorrentparams.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#include "base/path.h"
3838
#include "base/tagset.h"
39-
#include "sharelimitaction.h"
39+
#include "sharelimits.h"
4040
#include "sslparameters.h"
4141
#include "torrent.h"
4242
#include "torrentcontentlayout.h"
@@ -68,9 +68,9 @@ namespace BitTorrent
6868
std::optional<bool> useAutoTMM;
6969
int uploadLimit = -1;
7070
int downloadLimit = -1;
71-
int seedingTimeLimit = Torrent::USE_GLOBAL_SEEDING_TIME;
72-
int inactiveSeedingTimeLimit = Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME;
73-
qreal ratioLimit = Torrent::USE_GLOBAL_RATIO;
71+
int seedingTimeLimit = DEFAULT_SEEDING_TIME_LIMIT;
72+
int inactiveSeedingTimeLimit = DEFAULT_SEEDING_TIME_LIMIT;
73+
qreal ratioLimit = DEFAULT_RATIO_LIMIT;
7474
ShareLimitAction shareLimitAction = ShareLimitAction::Default;
7575
SSLParameters sslParameters;
7676

src/base/bittorrent/bencoderesumedatastorage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
239239
torrentParams.comment = fromLTString(resumeDataRoot.dict_find_string_value("qBt-comment"));
240240
torrentParams.hasFinishedStatus = resumeDataRoot.dict_find_int_value("qBt-seedStatus");
241241
torrentParams.firstLastPiecePriority = resumeDataRoot.dict_find_int_value("qBt-firstLastPiecePriority");
242-
torrentParams.seedingTimeLimit = resumeDataRoot.dict_find_int_value("qBt-seedingTimeLimit", Torrent::USE_GLOBAL_SEEDING_TIME);
243-
torrentParams.inactiveSeedingTimeLimit = resumeDataRoot.dict_find_int_value("qBt-inactiveSeedingTimeLimit", Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME);
242+
torrentParams.seedingTimeLimit = resumeDataRoot.dict_find_int_value("qBt-seedingTimeLimit", DEFAULT_SEEDING_TIME_LIMIT);
243+
torrentParams.inactiveSeedingTimeLimit = resumeDataRoot.dict_find_int_value("qBt-inactiveSeedingTimeLimit", DEFAULT_SEEDING_TIME_LIMIT);
244244
torrentParams.shareLimitAction = Utils::String::toEnum(
245245
fromLTString(resumeDataRoot.dict_find_string_value("qBt-shareLimitAction")), ShareLimitAction::Default);
246246

@@ -283,7 +283,7 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
283283

284284
const lt::string_view ratioLimitString = resumeDataRoot.dict_find_string_value("qBt-ratioLimit");
285285
if (ratioLimitString.empty())
286-
torrentParams.ratioLimit = resumeDataRoot.dict_find_int_value("qBt-ratioLimit", Torrent::USE_GLOBAL_RATIO * 1000) / 1000.0;
286+
torrentParams.ratioLimit = resumeDataRoot.dict_find_int_value("qBt-ratioLimit", DEFAULT_RATIO_LIMIT * 1000) / 1000.0;
287287
else
288288
torrentParams.ratioLimit = fromLTString(ratioLimitString).toDouble();
289289

src/base/bittorrent/categoryoptions.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Bittorrent Client using Qt and libtorrent.
3-
* Copyright (C) 2021-2023 Vladimir Golovnev <[email protected]>
3+
* Copyright (C) 2021-2025 Vladimir Golovnev <[email protected]>
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU General Public License
@@ -32,10 +32,16 @@
3232
#include <QJsonValue>
3333

3434
#include "base/global.h"
35+
#include "base/utils/string.h"
3536

3637
const QString OPTION_SAVEPATH = u"save_path"_s;
3738
const QString OPTION_DOWNLOADPATH = u"download_path"_s;
3839

40+
const QString OPTION_RATIOLIMIT = u"ratio_limit"_s;
41+
const QString OPTION_SEEDINGTIMELIMIT = u"seeding_time_limit"_s;
42+
const QString OPTION_INACTIVESEEDINGTIMELIMIT = u"inactive_seeding_time_limit"_s;
43+
const QString OPTION_SHARELIMITACTION = u"share_limit_action"_s;
44+
3945
BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObject &jsonObj)
4046
{
4147
CategoryOptions options;
@@ -47,6 +53,11 @@ BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObj
4753
else if (downloadPathValue.isString())
4854
options.downloadPath = {true, Path(downloadPathValue.toString())};
4955

56+
options.ratioLimit = jsonObj.value(OPTION_RATIOLIMIT).toDouble(DEFAULT_RATIO_LIMIT);
57+
options.seedingTimeLimit = jsonObj.value(OPTION_SEEDINGTIMELIMIT).toInt(DEFAULT_SEEDING_TIME_LIMIT);
58+
options.inactiveSeedingTimeLimit = jsonObj.value(OPTION_INACTIVESEEDINGTIMELIMIT).toInt(DEFAULT_SEEDING_TIME_LIMIT);
59+
options.shareLimitAction = Utils::String::toEnum<ShareLimitAction>(jsonObj.value(OPTION_SHARELIMITACTION).toString(), ShareLimitAction::Default);
60+
5061
return options;
5162
}
5263

@@ -63,12 +74,10 @@ QJsonObject BitTorrent::CategoryOptions::toJSON() const
6374

6475
return {
6576
{OPTION_SAVEPATH, savePath.data()},
66-
{OPTION_DOWNLOADPATH, downloadPathValue}
77+
{OPTION_DOWNLOADPATH, downloadPathValue},
78+
{OPTION_RATIOLIMIT, ratioLimit},
79+
{OPTION_SEEDINGTIMELIMIT, seedingTimeLimit},
80+
{OPTION_INACTIVESEEDINGTIMELIMIT, inactiveSeedingTimeLimit},
81+
{OPTION_SHARELIMITACTION, Utils::String::fromEnum(shareLimitAction)}
6782
};
6883
}
69-
70-
bool BitTorrent::operator==(const BitTorrent::CategoryOptions &left, const BitTorrent::CategoryOptions &right)
71-
{
72-
return ((left.savePath == right.savePath)
73-
&& (left.downloadPath == right.downloadPath));
74-
}

src/base/bittorrent/categoryoptions.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Bittorrent Client using Qt and libtorrent.
3-
* Copyright (C) 2021-2023 Vladimir Golovnev <[email protected]>
3+
* Copyright (C) 2021-2025 Vladimir Golovnev <[email protected]>
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU General Public License
@@ -34,6 +34,8 @@
3434

3535
#include "base/path.h"
3636
#include "downloadpathoption.h"
37+
#include "sharelimits.h"
38+
#include "torrent.h"
3739

3840
class QJsonObject;
3941

@@ -44,9 +46,14 @@ namespace BitTorrent
4446
Path savePath;
4547
std::optional<DownloadPathOption> downloadPath;
4648

49+
qreal ratioLimit = DEFAULT_RATIO_LIMIT;
50+
int seedingTimeLimit = DEFAULT_SEEDING_TIME_LIMIT;
51+
int inactiveSeedingTimeLimit = DEFAULT_SEEDING_TIME_LIMIT;
52+
ShareLimitAction shareLimitAction = ShareLimitAction::Default;
53+
4754
static CategoryOptions fromJSON(const QJsonObject &jsonObj);
4855
QJsonObject toJSON() const;
49-
};
5056

51-
bool operator==(const CategoryOptions &left, const CategoryOptions &right);
57+
friend bool operator==(const CategoryOptions &, const CategoryOptions &) = default;
58+
};
5259
}

src/base/bittorrent/loadtorrentparams.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "base/path.h"
3636
#include "base/tagset.h"
37-
#include "sharelimitaction.h"
37+
#include "sharelimits.h"
3838
#include "sslparameters.h"
3939
#include "torrent.h"
4040
#include "torrentcontentlayout.h"
@@ -61,9 +61,9 @@ namespace BitTorrent
6161

6262
bool addToQueueTop = false; // only for new torrents
6363

64-
qreal ratioLimit = Torrent::USE_GLOBAL_RATIO;
65-
int seedingTimeLimit = Torrent::USE_GLOBAL_SEEDING_TIME;
66-
int inactiveSeedingTimeLimit = Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME;
64+
qreal ratioLimit = DEFAULT_RATIO_LIMIT;
65+
int seedingTimeLimit = DEFAULT_SEEDING_TIME_LIMIT;
66+
int inactiveSeedingTimeLimit = DEFAULT_SEEDING_TIME_LIMIT;
6767
ShareLimitAction shareLimitAction = ShareLimitAction::Default;
6868

6969
SSLParameters sslParameters;

src/base/bittorrent/session.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "addtorrenterror.h"
3838
#include "addtorrentparams.h"
3939
#include "categoryoptions.h"
40-
#include "sharelimitaction.h"
40+
#include "sharelimits.h"
4141
#include "torrentcontentremoveoption.h"
4242
#include "trackerentry.h"
4343
#include "trackerentrystatus.h"
@@ -158,12 +158,16 @@ namespace BitTorrent
158158

159159
virtual QStringList categories() const = 0;
160160
virtual CategoryOptions categoryOptions(const QString &categoryName) const = 0;
161+
virtual bool setCategoryOptions(const QString &categoryName, const CategoryOptions &options) = 0;
161162
virtual Path categorySavePath(const QString &categoryName) const = 0;
162163
virtual Path categorySavePath(const QString &categoryName, const CategoryOptions &options) const = 0;
163164
virtual Path categoryDownloadPath(const QString &categoryName) const = 0;
164165
virtual Path categoryDownloadPath(const QString &categoryName, const CategoryOptions &options) const = 0;
166+
virtual qreal categoryRatioLimit(const QString &categoryName) const = 0;
167+
virtual int categorySeedingTimeLimit(const QString &categoryName) const = 0;
168+
virtual int categoryInactiveSeedingTimeLimit(const QString &categoryName) const = 0;
169+
virtual ShareLimitAction categoryShareLimitAction(const QString &categoryName) const = 0;
165170
virtual bool addCategory(const QString &name, const CategoryOptions &options = {}) = 0;
166-
virtual bool editCategory(const QString &name, const CategoryOptions &options) = 0;
167171
virtual bool removeCategory(const QString &name) = 0;
168172
virtual bool useCategoryPathsInManualMode() const = 0;
169173
virtual void setUseCategoryPathsInManualMode(bool value) = 0;

src/base/bittorrent/sessionimpl.cpp

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,9 @@ SessionImpl::SessionImpl(QObject *parent)
513513
, m_additionalTrackersURL(BITTORRENT_SESSION_KEY(u"AdditionalTrackersURL"_s))
514514
, m_globalMaxRatio(BITTORRENT_SESSION_KEY(u"GlobalMaxRatio"_s), -1, [](qreal r) { return r < 0 ? -1. : r; })
515515
, m_globalMaxSeedingMinutes(BITTORRENT_SESSION_KEY(u"GlobalMaxSeedingMinutes"_s)
516-
, Torrent::NO_SEEDING_TIME_LIMIT, lowerLimited(Torrent::NO_SEEDING_TIME_LIMIT))
516+
, NO_SEEDING_TIME_LIMIT, lowerLimited(NO_SEEDING_TIME_LIMIT))
517517
, m_globalMaxInactiveSeedingMinutes(BITTORRENT_SESSION_KEY(u"GlobalMaxInactiveSeedingMinutes"_s)
518-
, Torrent::NO_INACTIVE_SEEDING_TIME_LIMIT, lowerLimited(Torrent::NO_INACTIVE_SEEDING_TIME_LIMIT))
518+
, NO_SEEDING_TIME_LIMIT, lowerLimited(NO_SEEDING_TIME_LIMIT))
519519
, m_isAddTorrentToQueueTop(BITTORRENT_SESSION_KEY(u"AddTorrentToTopOfQueue"_s), false)
520520
, m_isAddTorrentStopped(BITTORRENT_SESSION_KEY(u"AddTorrentStopped"_s), false)
521521
, m_torrentStopCondition(BITTORRENT_SESSION_KEY(u"TorrentStopCondition"_s), Torrent::StopCondition::None)
@@ -972,6 +972,62 @@ Path SessionImpl::categoryDownloadPath(const QString &categoryName, const Catego
972972
return (basePath / path);
973973
}
974974

975+
qreal SessionImpl::categoryRatioLimit(const QString &categoryName) const
976+
{
977+
if (categoryName.isEmpty())
978+
return globalMaxRatio();
979+
980+
if (const auto ratioLimit = categoryOptions(categoryName).ratioLimit;
981+
ratioLimit != DEFAULT_RATIO_LIMIT)
982+
{
983+
return ratioLimit;
984+
}
985+
986+
return categoryRatioLimit(parentCategoryName(categoryName));
987+
}
988+
989+
int SessionImpl::categorySeedingTimeLimit(const QString &categoryName) const
990+
{
991+
if (categoryName.isEmpty())
992+
return globalMaxSeedingMinutes();
993+
994+
if (const auto seedingTimeLimit = categoryOptions(categoryName).seedingTimeLimit;
995+
seedingTimeLimit != DEFAULT_SEEDING_TIME_LIMIT)
996+
{
997+
return seedingTimeLimit;
998+
}
999+
1000+
return categorySeedingTimeLimit(parentCategoryName(categoryName));
1001+
}
1002+
1003+
int SessionImpl::categoryInactiveSeedingTimeLimit(const QString &categoryName) const
1004+
{
1005+
if (categoryName.isEmpty())
1006+
return globalMaxInactiveSeedingMinutes();
1007+
1008+
if (const auto inactiveSeedingTimeLimit = categoryOptions(categoryName).inactiveSeedingTimeLimit;
1009+
inactiveSeedingTimeLimit != DEFAULT_SEEDING_TIME_LIMIT)
1010+
{
1011+
return inactiveSeedingTimeLimit;
1012+
}
1013+
1014+
return categoryInactiveSeedingTimeLimit(parentCategoryName(categoryName));
1015+
}
1016+
1017+
ShareLimitAction SessionImpl::categoryShareLimitAction(const QString &categoryName) const
1018+
{
1019+
if (categoryName.isEmpty())
1020+
return shareLimitAction();
1021+
1022+
if (const auto shareLimitAction = categoryOptions(categoryName).shareLimitAction;
1023+
shareLimitAction != ShareLimitAction::Default)
1024+
{
1025+
return shareLimitAction;
1026+
}
1027+
1028+
return categoryShareLimitAction(parentCategoryName(categoryName));
1029+
}
1030+
9751031
DownloadPathOption SessionImpl::resolveCategoryDownloadPathOption(const QString &categoryName, const std::optional<DownloadPathOption> &option) const
9761032
{
9771033
if (categoryName.isEmpty())
@@ -1008,24 +1064,25 @@ bool SessionImpl::addCategory(const QString &name, const CategoryOptions &option
10081064
return true;
10091065
}
10101066

1011-
bool SessionImpl::editCategory(const QString &name, const CategoryOptions &options)
1067+
bool SessionImpl::setCategoryOptions(const QString &categoryName, const CategoryOptions &options)
10121068
{
1013-
const auto it = m_categories.find(name);
1069+
const auto it = m_categories.find(categoryName);
10141070
if (it == m_categories.end())
10151071
return false;
10161072

10171073
CategoryOptions &currentOptions = it.value();
10181074
if (options == currentOptions)
10191075
return false;
10201076

1021-
if (isDisableAutoTMMWhenCategorySavePathChanged())
1077+
if (isDisableAutoTMMWhenCategorySavePathChanged()
1078+
&& ((options.savePath != currentOptions.savePath) || (options.downloadPath != currentOptions.downloadPath)))
10221079
{
10231080
// This should be done before changing the category options
10241081
// to prevent the torrent from being moved at the new save path.
10251082

10261083
for (TorrentImpl *const torrent : asConst(m_torrents))
10271084
{
1028-
if (torrent->category() == name)
1085+
if (torrent->category() == categoryName)
10291086
torrent->setAutoTMMEnabled(false);
10301087
}
10311088
}
@@ -1035,11 +1092,11 @@ bool SessionImpl::editCategory(const QString &name, const CategoryOptions &optio
10351092

10361093
for (TorrentImpl *const torrent : asConst(m_torrents))
10371094
{
1038-
if (torrent->category() == name)
1095+
if (torrent->category() == categoryName)
10391096
torrent->handleCategoryOptionsChanged();
10401097
}
10411098

1042-
emit categoryOptionsChanged(name);
1099+
emit categoryOptionsChanged(categoryName);
10431100
return true;
10441101
}
10451102

@@ -1235,7 +1292,7 @@ qreal SessionImpl::globalMaxRatio() const
12351292
void SessionImpl::setGlobalMaxRatio(qreal ratio)
12361293
{
12371294
if (ratio < 0)
1238-
ratio = Torrent::NO_RATIO_LIMIT;
1295+
ratio = NO_RATIO_LIMIT;
12391296

12401297
if (ratio != globalMaxRatio())
12411298
{
@@ -1251,7 +1308,7 @@ int SessionImpl::globalMaxSeedingMinutes() const
12511308

12521309
void SessionImpl::setGlobalMaxSeedingMinutes(int minutes)
12531310
{
1254-
minutes = std::max(minutes, Torrent::NO_SEEDING_TIME_LIMIT);
1311+
minutes = std::max(minutes, NO_SEEDING_TIME_LIMIT);
12551312

12561313
if (minutes != globalMaxSeedingMinutes())
12571314
{
@@ -1267,7 +1324,7 @@ int SessionImpl::globalMaxInactiveSeedingMinutes() const
12671324

12681325
void SessionImpl::setGlobalMaxInactiveSeedingMinutes(int minutes)
12691326
{
1270-
minutes = std::max(minutes, Torrent::NO_INACTIVE_SEEDING_TIME_LIMIT);
1327+
minutes = std::max(minutes, NO_SEEDING_TIME_LIMIT);
12711328

12721329
if (minutes != globalMaxInactiveSeedingMinutes())
12731330
{
@@ -2310,14 +2367,9 @@ void SessionImpl::processTorrentShareLimits(TorrentImpl *torrent)
23102367
if (!torrent->isFinished() || torrent->isForced())
23112368
return;
23122369

2313-
const auto effectiveLimit = []<typename T>(const T limit, const T useGlobalLimit, const T globalLimit) -> T
2314-
{
2315-
return (limit == useGlobalLimit) ? globalLimit : limit;
2316-
};
2317-
2318-
const qreal ratioLimit = effectiveLimit(torrent->ratioLimit(), Torrent::USE_GLOBAL_RATIO, globalMaxRatio());
2319-
const int seedingTimeLimit = effectiveLimit(torrent->seedingTimeLimit(), Torrent::USE_GLOBAL_SEEDING_TIME, globalMaxSeedingMinutes());
2320-
const int inactiveSeedingTimeLimit = effectiveLimit(torrent->inactiveSeedingTimeLimit(), Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME, globalMaxInactiveSeedingMinutes());
2370+
const qreal ratioLimit = torrent->effectiveRatioLimit();
2371+
const int seedingTimeLimit = torrent->effectiveSeedingTimeLimit();
2372+
const int inactiveSeedingTimeLimit = torrent->effectiveInactiveSeedingTimeLimit();
23212373

23222374
bool reached = false;
23232375
QString description;
@@ -2344,7 +2396,7 @@ void SessionImpl::processTorrentShareLimits(TorrentImpl *torrent)
23442396
if (reached)
23452397
{
23462398
const QString torrentName = tr("Torrent: \"%1\".").arg(torrent->name());
2347-
const ShareLimitAction shareLimitAction = (torrent->shareLimitAction() == ShareLimitAction::Default) ? m_shareLimitAction : torrent->shareLimitAction();
2399+
const ShareLimitAction shareLimitAction = torrent->effectiveShareLimitAction();
23482400

23492401
if (shareLimitAction == ShareLimitAction::Remove)
23502402
{
@@ -5172,9 +5224,9 @@ bool SessionImpl::isKnownTorrent(const InfoHash &infoHash) const
51725224

51735225
void SessionImpl::updateSeedingLimitTimer()
51745226
{
5175-
if ((globalMaxRatio() == Torrent::NO_RATIO_LIMIT) && !hasPerTorrentRatioLimit()
5176-
&& (globalMaxSeedingMinutes() == Torrent::NO_SEEDING_TIME_LIMIT) && !hasPerTorrentSeedingTimeLimit()
5177-
&& (globalMaxInactiveSeedingMinutes() == Torrent::NO_INACTIVE_SEEDING_TIME_LIMIT) && !hasPerTorrentInactiveSeedingTimeLimit())
5227+
if ((globalMaxRatio() == NO_RATIO_LIMIT) && !hasPerTorrentRatioLimit()
5228+
&& (globalMaxSeedingMinutes() == NO_SEEDING_TIME_LIMIT) && !hasPerTorrentSeedingTimeLimit()
5229+
&& (globalMaxInactiveSeedingMinutes() == NO_SEEDING_TIME_LIMIT) && !hasPerTorrentInactiveSeedingTimeLimit())
51785230
{
51795231
if (m_seedingLimitTimer->isActive())
51805232
m_seedingLimitTimer->stop();

0 commit comments

Comments
 (0)