mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-25 10:46:15 +03:00
Fix Incomplete Save Path cannot be changed for torrents without metadata
PR #21152. Closes #21140.
This commit is contained in:
parent
3ad8fcbdd2
commit
7dfb0110d4
1 changed files with 15 additions and 2 deletions
|
@ -460,6 +460,8 @@ Path TorrentImpl::savePath() const
|
|||
void TorrentImpl::setSavePath(const Path &path)
|
||||
{
|
||||
Q_ASSERT(!isAutoTMMEnabled());
|
||||
if (isAutoTMMEnabled()) [[unlikely]]
|
||||
return;
|
||||
|
||||
const Path basePath = m_session->useCategoryPathsInManualMode()
|
||||
? m_session->categorySavePath(category()) : m_session->savePath();
|
||||
|
@ -487,6 +489,8 @@ Path TorrentImpl::downloadPath() const
|
|||
void TorrentImpl::setDownloadPath(const Path &path)
|
||||
{
|
||||
Q_ASSERT(!isAutoTMMEnabled());
|
||||
if (isAutoTMMEnabled()) [[unlikely]]
|
||||
return;
|
||||
|
||||
const Path basePath = m_session->useCategoryPathsInManualMode()
|
||||
? m_session->categoryDownloadPath(category()) : m_session->downloadPath();
|
||||
|
@ -1957,9 +1961,18 @@ void TorrentImpl::start(const TorrentOperatingMode mode)
|
|||
void TorrentImpl::moveStorage(const Path &newPath, const MoveStorageContext context)
|
||||
{
|
||||
if (!hasMetadata())
|
||||
{
|
||||
if (context == MoveStorageContext::ChangeSavePath)
|
||||
{
|
||||
m_savePath = newPath;
|
||||
m_session->handleTorrentSavePathChanged(this);
|
||||
}
|
||||
else if (context == MoveStorageContext::ChangeDownloadPath)
|
||||
{
|
||||
m_downloadPath = newPath;
|
||||
m_session->handleTorrentSavePathChanged(this);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue