mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Remove misc::removeEmptyFolder()
This commit is contained in:
parent
c25586b500
commit
b43e641d21
3 changed files with 3 additions and 15 deletions
|
@ -796,7 +796,7 @@ void QBtSession::deleteTorrent(const QString &hash, bool delete_local_files) {
|
|||
QFile::remove(uneeded_file);
|
||||
const QString parent_folder = misc::branchPath(uneeded_file);
|
||||
qDebug("Attempt to remove parent folder (if empty): %s", qPrintable(parent_folder));
|
||||
misc::removeEmptyFolder(parent_folder);
|
||||
QDir().rmdir(parent_folder);
|
||||
}
|
||||
}
|
||||
// Remove it from torrent backup directory
|
||||
|
@ -2357,7 +2357,7 @@ void QBtSession::readAlerts() {
|
|||
if(savePathsToRemove.contains(hash)) {
|
||||
const QString dirpath = savePathsToRemove.take(hash);
|
||||
qDebug() << "Removing save path: " << dirpath << "...";
|
||||
bool ok = misc::removeEmptyFolder(dirpath);
|
||||
bool ok = QDir().rmdir(dirpath);
|
||||
Q_UNUSED(ok);
|
||||
qDebug() << "Folder was removed: " << ok;
|
||||
}
|
||||
|
@ -2366,7 +2366,7 @@ void QBtSession::readAlerts() {
|
|||
qDebug() << "hash is empty, use fallback to remove save path";
|
||||
foreach(const QString& key, savePathsToRemove.keys()) {
|
||||
// Attempt to delete
|
||||
if(misc::removeEmptyFolder(savePathsToRemove[key])) {
|
||||
if(QDir().rmdir(savePathsToRemove[key])) {
|
||||
savePathsToRemove.remove(key);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue