mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 00:17:23 -06:00
Merge pull request #6140 from Chocobo1/relocateNoRemove
After files relocate, don't remove the old folder even if it is empty
This commit is contained in:
@@ -1286,7 +1286,7 @@ void TorrentHandle::moveStorage(const QString &newPath)
|
||||
m_queuedPath = newPath;
|
||||
}
|
||||
else {
|
||||
QString oldPath = nativeActualSavePath();
|
||||
const QString oldPath = nativeActualSavePath();
|
||||
if (QDir(oldPath) == QDir(newPath)) return;
|
||||
|
||||
qDebug("move storage: %s to %s", qPrintable(oldPath), qPrintable(newPath));
|
||||
@@ -1353,7 +1353,7 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p)
|
||||
return;
|
||||
}
|
||||
|
||||
QString newPath = Utils::String::fromStdString(p->path);
|
||||
const QString newPath = Utils::String::fromStdString(p->path);
|
||||
if (newPath != m_newPath) {
|
||||
qWarning() << Q_FUNC_INFO << ": New path doesn't match a path in a queue.";
|
||||
return;
|
||||
@@ -1373,13 +1373,6 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p)
|
||||
m_session->handleTorrentSavePathChanged(this);
|
||||
}
|
||||
|
||||
// Attempt to remove old folder if empty
|
||||
QDir oldSaveDir(Utils::Fs::fromNativePath(m_oldPath));
|
||||
if (oldSaveDir != QDir(m_session->defaultSavePath())) {
|
||||
qDebug("Attempting to remove %s", qPrintable(m_oldPath));
|
||||
QDir().rmpath(m_oldPath);
|
||||
}
|
||||
|
||||
while (!isMoveInProgress() && (m_renameCount == 0) && !m_moveFinishedTriggers.isEmpty())
|
||||
m_moveFinishedTriggers.takeFirst()();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user