mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Fix explicit Torrent Management Mode in Add New Torrent dialog. Closes #5602.
This commit is contained in:
parent
8214d25f9f
commit
6270433237
4 changed files with 13 additions and 3 deletions
|
@ -51,5 +51,6 @@ namespace BitTorrent
|
||||||
bool ignoreShareLimits = false;
|
bool ignoreShareLimits = false;
|
||||||
bool skipChecking = false;
|
bool skipChecking = false;
|
||||||
TriStateBool createSubfolder;
|
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,
|
bool Session::addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri,
|
||||||
TorrentInfo torrentInfo, const QByteArray &fastresumeData)
|
TorrentInfo torrentInfo, const QByteArray &fastresumeData)
|
||||||
{
|
{
|
||||||
addData.savePath = normalizeSavePath(
|
addData.savePath = normalizeSavePath(addData.savePath, "");
|
||||||
addData.savePath,
|
|
||||||
((!addData.resumed && isAutoTMMDisabledByDefault()) ? defaultSavePath() : ""));
|
|
||||||
|
|
||||||
if (!addData.category.isEmpty()) {
|
if (!addData.category.isEmpty()) {
|
||||||
if (!m_categories.contains(addData.category) && !addCategory(addData.category)) {
|
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)
|
, 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)
|
||||||
{
|
{
|
||||||
|
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
|
// TorrentState
|
||||||
|
|
|
@ -624,11 +624,15 @@ void AddNewTorrentDialog::accept()
|
||||||
|
|
||||||
QString savePath = ui->savePath->selectedPath();
|
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.
|
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;
|
m_torrentParams.savePath = savePath;
|
||||||
saveSavePathHistory();
|
saveSavePathHistory();
|
||||||
if (ui->defaultSavePathCheckBox->isChecked())
|
if (ui->defaultSavePathCheckBox->isChecked())
|
||||||
BitTorrent::Session::instance()->setDefaultSavePath(savePath);
|
BitTorrent::Session::instance()->setDefaultSavePath(savePath);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
m_torrentParams.useAutoTMM = TriStateBool::True;
|
||||||
|
}
|
||||||
|
|
||||||
setEnabled(!ui->never_show_cb->isChecked());
|
setEnabled(!ui->never_show_cb->isChecked());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue