mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 05:13:30 -07:00
Add uploadLimit, downloadLimit fields to AddTorrentData & AddTorrentParams
This commit is contained in:
parent
e07501252c
commit
66b86888fc
4 changed files with 10 additions and 0 deletions
|
@ -52,5 +52,7 @@ namespace BitTorrent
|
||||||
bool skipChecking = false;
|
bool skipChecking = false;
|
||||||
TriStateBool createSubfolder;
|
TriStateBool createSubfolder;
|
||||||
TriStateBool useAutoTMM;
|
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_connections = maxConnectionsPerTorrent();
|
||||||
p.max_uploads = maxUploadsPerTorrent();
|
p.max_uploads = maxUploadsPerTorrent();
|
||||||
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
|
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
|
||||||
|
p.upload_limit = addData.uploadLimit;
|
||||||
|
p.download_limit = addData.downloadLimit;
|
||||||
|
|
||||||
m_addingTorrents.insert(hash, addData);
|
m_addingTorrents.insert(hash, addData);
|
||||||
// Adding torrent to BitTorrent session
|
// Adding torrent to BitTorrent session
|
||||||
|
|
|
@ -95,6 +95,8 @@ AddTorrentData::AddTorrentData()
|
||||||
, hasRootFolder(true)
|
, hasRootFolder(true)
|
||||||
, addForced(false)
|
, addForced(false)
|
||||||
, addPaused(false)
|
, addPaused(false)
|
||||||
|
, uploadLimit(-1)
|
||||||
|
, downloadLimit(-1)
|
||||||
, ratioLimit(TorrentHandle::USE_GLOBAL_RATIO)
|
, ratioLimit(TorrentHandle::USE_GLOBAL_RATIO)
|
||||||
, seedingTimeLimit(TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
, seedingTimeLimit(TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
||||||
{
|
{
|
||||||
|
@ -118,6 +120,8 @@ AddTorrentData::AddTorrentData(const AddTorrentParams ¶ms)
|
||||||
, addPaused(params.addPaused == TriStateBool::Undefined
|
, addPaused(params.addPaused == TriStateBool::Undefined
|
||||||
? Session::instance()->isAddTorrentPaused()
|
? Session::instance()->isAddTorrentPaused()
|
||||||
: params.addPaused == TriStateBool::True)
|
: params.addPaused == TriStateBool::True)
|
||||||
|
, uploadLimit(params.uploadLimit)
|
||||||
|
, downloadLimit(params.downloadLimit)
|
||||||
, filePriorities(params.filePriorities)
|
, filePriorities(params.filePriorities)
|
||||||
, ratioLimit(params.ignoreShareLimits ? TorrentHandle::NO_RATIO_LIMIT : TorrentHandle::USE_GLOBAL_RATIO)
|
, ratioLimit(params.ignoreShareLimits ? TorrentHandle::NO_RATIO_LIMIT : TorrentHandle::USE_GLOBAL_RATIO)
|
||||||
, seedingTimeLimit(params.ignoreShareLimits ? TorrentHandle::NO_SEEDING_TIME_LIMIT : TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
, seedingTimeLimit(params.ignoreShareLimits ? TorrentHandle::NO_SEEDING_TIME_LIMIT : TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
||||||
|
|
|
@ -104,6 +104,8 @@ namespace BitTorrent
|
||||||
bool hasRootFolder;
|
bool hasRootFolder;
|
||||||
bool addForced;
|
bool addForced;
|
||||||
bool addPaused;
|
bool addPaused;
|
||||||
|
int uploadLimit;
|
||||||
|
int downloadLimit;
|
||||||
// for new torrents
|
// for new torrents
|
||||||
QVector<int> filePriorities;
|
QVector<int> filePriorities;
|
||||||
// for resumed torrents
|
// for resumed torrents
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue