mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Use native QDir::removeRecursively() in Qt5.
This commit is contained in:
parent
1396c63525
commit
de712c6ba9
1 changed files with 6 additions and 1 deletions
|
@ -182,7 +182,11 @@ bool Utils::Fs::forceRemove(const QString& file_path)
|
||||||
* Removes directory and its content recursively.
|
* Removes directory and its content recursively.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Utils::Fs::removeDirRecursive(const QString& dirName) {
|
void Utils::Fs::removeDirRecursive(const QString& dirName)
|
||||||
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||||
|
QDir(dirName).removeRecursively();
|
||||||
|
#else
|
||||||
QDir dir(dirName);
|
QDir dir(dirName);
|
||||||
|
|
||||||
if (!dir.exists()) return;
|
if (!dir.exists()) return;
|
||||||
|
@ -197,6 +201,7 @@ void Utils::Fs::removeDirRecursive(const QString& dirName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
dir.rmdir(dirName);
|
dir.rmdir(dirName);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue