summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorAlexey Edelev <semlanik@gmail.com>2021-10-15 11:20:12 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2021-10-29 14:53:56 +0200
commitd273f387265ded4e33fff2c4452e6a03de4792b7 (patch)
treebe8c2819073d77801f285b0e3321c3f9a06c2e0f /src/tools
parent3b51b8c31df493ea2c9946c49fc2fc39690ed6a1 (diff)
Replace deleteRecursively function with QDir::removeRecursively
Use QDir::removeRecursively instead of deleteRecursively when cleaning up top-level build folders. Change-Id: Ifb406fc1965a0781eab4fd63a3764a84f4309d25 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/androiddeployqt/main.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 4ef16135d5..eb65d8509e 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -63,23 +63,6 @@ static const bool mustReadOutputAnyway = true; // pclose seems to return the wro
static QStringList dependenciesForDepfile;
-void deleteRecursively(const QString &dirName)
-{
- QDir dir(dirName);
- if (!dir.exists())
- return;
-
- const QFileInfoList entries = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs);
- for (const QFileInfo &entry : entries) {
- if (entry.isDir())
- deleteRecursively(entry.absoluteFilePath());
- else
- QFile::remove(entry.absoluteFilePath());
- }
-
- QDir().rmdir(dirName);
-}
-
FILE *openProcess(const QString &command)
{
#if defined(Q_OS_WIN32)
@@ -407,7 +390,7 @@ void deleteMissingFiles(const Options &options, const QDir &srcDir, const QDir &
fprintf(stdout, "%s not found in %s, removing it.\n", qPrintable(dst.fileName()), qPrintable(srcDir.absolutePath()));
if (dst.isDir())
- deleteRecursively(dst.absolutePath());
+ QDir{dst.absolutePath()}.removeRecursively();
else
QFile::remove(dst.absoluteFilePath());
}