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:
parent
e07501252c
commit
66b86888fc
@ -52,5 +52,7 @@ namespace BitTorrent
|
||||
bool skipChecking = false;
|
||||
TriStateBool createSubfolder;
|
||||
TriStateBool useAutoTMM;
|
||||
int uploadLimit = -1;
|
||||
int downloadLimit = -1;
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 ¶ms)
|
||||
, 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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user