mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-13 05:41:17 +00:00
Fix explicit Torrent Management Mode in Add New Torrent dialog. Closes #5602.
This commit is contained in:
parent
8214d25f9f
commit
6270433237
@ -51,5 +51,6 @@ namespace BitTorrent
|
||||
bool ignoreShareLimits = false;
|
||||
bool skipChecking = false;
|
||||
TriStateBool createSubfolder;
|
||||
TriStateBool useAutoTMM;
|
||||
};
|
||||
}
|
||||
|
@ -1855,9 +1855,7 @@ bool Session::addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams
|
||||
bool Session::addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri,
|
||||
TorrentInfo torrentInfo, const QByteArray &fastresumeData)
|
||||
{
|
||||
addData.savePath = normalizeSavePath(
|
||||
addData.savePath,
|
||||
((!addData.resumed && isAutoTMMDisabledByDefault()) ? defaultSavePath() : ""));
|
||||
addData.savePath = normalizeSavePath(addData.savePath, "");
|
||||
|
||||
if (!addData.category.isEmpty()) {
|
||||
if (!m_categories.contains(addData.category) && !addCategory(addData.category)) {
|
||||
|
@ -120,6 +120,13 @@ AddTorrentData::AddTorrentData(const AddTorrentParams ¶ms)
|
||||
, ratioLimit(params.ignoreShareLimits ? TorrentHandle::NO_RATIO_LIMIT : TorrentHandle::USE_GLOBAL_RATIO)
|
||||
, seedingTimeLimit(params.ignoreShareLimits ? TorrentHandle::NO_SEEDING_TIME_LIMIT : TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
||||
{
|
||||
bool useAutoTMM = (params.useAutoTMM == TriStateBool::Undefined
|
||||
? !Session::instance()->isAutoTMMDisabledByDefault()
|
||||
: params.useAutoTMM == TriStateBool::True);
|
||||
if (useAutoTMM)
|
||||
savePath = "";
|
||||
else if (savePath.trimmed().isEmpty())
|
||||
savePath = Session::instance()->defaultSavePath();
|
||||
}
|
||||
|
||||
// TorrentState
|
||||
|
@ -624,11 +624,15 @@ void AddNewTorrentDialog::accept()
|
||||
|
||||
QString savePath = ui->savePath->selectedPath();
|
||||
if (ui->comboTTM->currentIndex() != 1) { // 0 is Manual mode and 1 is Automatic mode. Handle all non 1 values as manual mode.
|
||||
m_torrentParams.useAutoTMM = TriStateBool::False;
|
||||
m_torrentParams.savePath = savePath;
|
||||
saveSavePathHistory();
|
||||
if (ui->defaultSavePathCheckBox->isChecked())
|
||||
BitTorrent::Session::instance()->setDefaultSavePath(savePath);
|
||||
}
|
||||
else {
|
||||
m_torrentParams.useAutoTMM = TriStateBool::True;
|
||||
}
|
||||
|
||||
setEnabled(!ui->never_show_cb->isChecked());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user