mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Improve folder removal behavior
This commit is contained in:
parent
feeecbf395
commit
15d3b07f34
3 changed files with 21 additions and 10 deletions
10
src/misc.cpp
10
src/misc.cpp
|
@ -799,3 +799,13 @@ QString misc::fileName(QString file_path)
|
|||
return file_path;
|
||||
return file_path.mid(slash_index+1);
|
||||
}
|
||||
|
||||
bool misc::removeEmptyFolder(const QString &dirpath)
|
||||
{
|
||||
QDir savedir(dirpath);
|
||||
const QString dirname = savedir.dirName();
|
||||
if(savedir.exists() && savedir.cdUp()) {
|
||||
return savedir.rmdir(dirname);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue