Browse Source

Use native QDir::removeRecursively() in Qt5.

adaptive-webui-19844
Vladimir Golovnev (Glassez) 10 years ago
parent
commit
de712c6ba9
  1. 7
      src/core/utils/fs.cpp

7
src/core/utils/fs.cpp

@ -182,7 +182,11 @@ bool Utils::Fs::forceRemove(const QString& file_path) @@ -182,7 +182,11 @@ bool Utils::Fs::forceRemove(const QString& file_path)
* 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);
if (!dir.exists()) return;
@ -197,6 +201,7 @@ void Utils::Fs::removeDirRecursive(const QString& dirName) { @@ -197,6 +201,7 @@ void Utils::Fs::removeDirRecursive(const QString& dirName) {
}
dir.rmdir(dirName);
#endif
}
/**

Loading…
Cancel
Save