mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
Improved folder removing code
This commit is contained in:
parent
c800a0a6b5
commit
cc532d95da
2 changed files with 2 additions and 3 deletions
|
@ -1955,7 +1955,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||||
const QString new_save_path = QString::fromLocal8Bit(p->path.c_str());
|
const QString new_save_path = QString::fromLocal8Bit(p->path.c_str());
|
||||||
qDebug("Torrent moved from %s to %s", qPrintable(old_save_path), qPrintable(new_save_path));
|
qDebug("Torrent moved from %s to %s", qPrintable(old_save_path), qPrintable(new_save_path));
|
||||||
qDebug("Attempting to remove %s", qPrintable(old_save_path));
|
qDebug("Attempting to remove %s", qPrintable(old_save_path));
|
||||||
QDir().rmpath(old_save_path);
|
if(old_save_path != defaultSavePath && old_save_path != defaultTempPath)
|
||||||
|
QDir().rmdir(old_save_path);
|
||||||
if(new_save_path != defaultTempPath)
|
if(new_save_path != defaultTempPath)
|
||||||
TorrentPersistentData::saveSavePath(h.hash(), new_save_path);
|
TorrentPersistentData::saveSavePath(h.hash(), new_save_path);
|
||||||
emit savePathChanged(h);
|
emit savePathChanged(h);
|
||||||
|
|
|
@ -729,8 +729,6 @@ void PropertiesWidget::renameSelectedFile() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Save savepath
|
|
||||||
TorrentPersistentData::saveSavePath(h.hash(), savePath.absolutePath());
|
|
||||||
// Actually move storage
|
// Actually move storage
|
||||||
if(!BTSession->useTemporaryFolder() || h.is_seed())
|
if(!BTSession->useTemporaryFolder() || h.is_seed())
|
||||||
h.move_storage(savePath.absolutePath());
|
h.move_storage(savePath.absolutePath());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue