mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Properly remove empty leftover folders after rename
TorrentInfo::origFilePath will return the very original path from .torrent file, not the most recent file path before the rename operation and thus the code would not be working as we expected.
This commit is contained in:
@@ -204,15 +204,6 @@ void TorrentContentTreeView::renameSelectedFile(BitTorrent::TorrentHandle *torre
|
||||
if (needForceRecheck)
|
||||
torrent->forceRecheck();
|
||||
|
||||
// Remove old folder
|
||||
const QString oldFullPath = torrent->savePath(true) + oldPath;
|
||||
int timeout = 10;
|
||||
while (!QDir().rmpath(oldFullPath) && (timeout > 0)) {
|
||||
// FIXME: We should not sleep here (freezes the UI for 1 second)
|
||||
QThread::msleep(100);
|
||||
--timeout;
|
||||
}
|
||||
|
||||
model->setData(modelIndex, newName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user