From 6cb62bc94e23c375088fe5300251e47d51c6f82a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 28 Jul 2021 10:41:58 +0200 Subject: [PATCH] App: Remove unused function Not only was "copyRecursively" copy/pasted, it is also unreferenced (by others than itself). Change-Id: I500fa42d31f5dbf97b2cb7ba5c144249c157ce57 Reviewed-by: Christian Stenger --- src/app/main.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 418f2f7ada6..0a08a3d4c3a 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -201,31 +201,6 @@ static inline int askMsgSendFailed() QMessageBox::Retry); } -// taken from utils/fileutils.cpp. We cannot use utils here since that depends app_version.h. -static bool copyRecursively(const QString &srcFilePath, const QString &tgtFilePath) -{ - QFileInfo srcFileInfo(srcFilePath); - if (srcFileInfo.isDir()) { - QDir targetDir(tgtFilePath); - targetDir.cdUp(); - if (!targetDir.mkdir(Utils::FilePath::fromString(tgtFilePath).fileName())) - return false; - QDir sourceDir(srcFilePath); - const QStringList fileNames = sourceDir.entryList - (QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System); - for (const QString &fileName : fileNames) { - const QString newSrcFilePath = srcFilePath + '/' + fileName; - const QString newTgtFilePath = tgtFilePath + '/' + fileName; - if (!copyRecursively(newSrcFilePath, newTgtFilePath)) - return false; - } - } else { - if (!QFile::copy(srcFilePath, tgtFilePath)) - return false; - } - return true; -} - static inline QStringList getPluginPaths() { QStringList rc(QDir::cleanPath(QApplication::applicationDirPath()