mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 18:04:32 +00:00
Correctly handle changing of global save path
This commit is contained in:
parent
a21bff1dbd
commit
04c1988665
@ -2525,18 +2525,27 @@ void Session::setSavePath(const Path &path)
|
|||||||
if (newPath == m_savePath)
|
if (newPath == m_savePath)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_savePath = newPath;
|
|
||||||
|
|
||||||
if (isDisableAutoTMMWhenDefaultSavePathChanged())
|
if (isDisableAutoTMMWhenDefaultSavePathChanged())
|
||||||
{
|
{
|
||||||
|
QSet<QString> affectedCatogories {{}}; // includes default (unnamed) category
|
||||||
|
for (auto it = m_categories.cbegin(); it != m_categories.cend(); ++it)
|
||||||
|
{
|
||||||
|
const QString &categoryName = it.key();
|
||||||
|
const CategoryOptions &categoryOptions = it.value();
|
||||||
|
if (categoryOptions.savePath.isRelative())
|
||||||
|
affectedCatogories.insert(categoryName);
|
||||||
|
}
|
||||||
|
|
||||||
for (TorrentImpl *const torrent : asConst(m_torrents))
|
for (TorrentImpl *const torrent : asConst(m_torrents))
|
||||||
torrent->setAutoTMMEnabled(false);
|
{
|
||||||
}
|
if (affectedCatogories.contains(torrent->category()))
|
||||||
else
|
torrent->setAutoTMMEnabled(false);
|
||||||
{
|
}
|
||||||
for (TorrentImpl *const torrent : asConst(m_torrents))
|
|
||||||
torrent->handleCategoryOptionsChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_savePath = newPath;
|
||||||
|
for (TorrentImpl *const torrent : asConst(m_torrents))
|
||||||
|
torrent->handleCategoryOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setDownloadPath(const Path &path)
|
void Session::setDownloadPath(const Path &path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user