From d273f387265ded4e33fff2c4452e6a03de4792b7 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Fri, 15 Oct 2021 11:20:12 +0200 Subject: 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 Reviewed-by: Qt CI Bot --- src/tools/androiddeployqt/main.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/tools') 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()); } -- cgit v1.2.3