1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-03 02:14:16 +00:00

Add uploadLimit, downloadLimit fields to AddTorrentData & AddTorrentParams

This commit is contained in:
Chocobo1 2017-08-14 19:44:56 +08:00
parent e07501252c
commit 66b86888fc
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
4 changed files with 10 additions and 0 deletions

View File

@ -52,5 +52,7 @@ namespace BitTorrent
bool skipChecking = false;
TriStateBool createSubfolder;
TriStateBool useAutoTMM;
int uploadLimit = -1;
int downloadLimit = -1;
};
}

View File

@ -2193,6 +2193,8 @@ bool Session::addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri
p.max_connections = maxConnectionsPerTorrent();
p.max_uploads = maxUploadsPerTorrent();
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
p.upload_limit = addData.uploadLimit;
p.download_limit = addData.downloadLimit;
m_addingTorrents.insert(hash, addData);
// Adding torrent to BitTorrent session

View File

@ -95,6 +95,8 @@ AddTorrentData::AddTorrentData()
, hasRootFolder(true)
, addForced(false)
, addPaused(false)
, uploadLimit(-1)
, downloadLimit(-1)
, ratioLimit(TorrentHandle::USE_GLOBAL_RATIO)
, seedingTimeLimit(TorrentHandle::USE_GLOBAL_SEEDING_TIME)
{
@ -118,6 +120,8 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &params)
, addPaused(params.addPaused == TriStateBool::Undefined
? Session::instance()->isAddTorrentPaused()
: params.addPaused == TriStateBool::True)
, uploadLimit(params.uploadLimit)
, downloadLimit(params.downloadLimit)
, filePriorities(params.filePriorities)
, ratioLimit(params.ignoreShareLimits ? TorrentHandle::NO_RATIO_LIMIT : TorrentHandle::USE_GLOBAL_RATIO)
, seedingTimeLimit(params.ignoreShareLimits ? TorrentHandle::NO_SEEDING_TIME_LIMIT : TorrentHandle::USE_GLOBAL_SEEDING_TIME)

View File

@ -104,6 +104,8 @@ namespace BitTorrent
bool hasRootFolder;
bool addForced;
bool addPaused;
int uploadLimit;
int downloadLimit;
// for new torrents
QVector<int> filePriorities;
// for resumed torrents