diff options
author | Jonas Kvinge <jonas@jkvinge.net> | 2021-10-30 19:30:32 +0200 |
---|---|---|
committer | Jonas Kvinge <jonas@jkvinge.net> | 2021-11-01 22:43:29 +0200 |
commit | 104a81d47cf76b54b275b0427693fd1402fe9579 (patch) | |
tree | f1dea95ab553361f7e5ae0d39895679370354285 | |
parent | c9dc5e7f807a1de344f3569c0db747364c413300 (diff) |
macdeployqt: Use static QFile::exists() and QFileInfo::exists()
Change-Id: If2fd409fbd53535cf4823bed831217c196a070ba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r-- | src/macdeployqt/macdeployqt/main.cpp | 2 | ||||
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp index 26f1da6e5..145ee854a 100644 --- a/src/macdeployqt/macdeployqt/main.cpp +++ b/src/macdeployqt/macdeployqt/main.cpp @@ -82,7 +82,7 @@ int main(int argc, char **argv) appBundlePath = QDir::cleanPath(appBundlePath); - if (QDir().exists(appBundlePath) == false) { + if (!QDir(appBundlePath).exists()) { qDebug() << "Error: Could not find app bundle" << appBundlePath; return 1; } diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index af21caa50..33fc5ffed 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -98,7 +98,7 @@ inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info) bool copyFilePrintStatus(const QString &from, const QString &to) { - if (QFile(to).exists()) { + if (QFile::exists(to)) { if (alwaysOwerwriteEnabled) { QFile(to).remove(); } else { @@ -135,7 +135,7 @@ bool copyFilePrintStatus(const QString &from, const QString &to) bool linkFilePrintStatus(const QString &file, const QString &link) { - if (QFile(link).exists()) { + if (QFile::exists(link)) { if (QFile(link).symLinkTarget().isEmpty()) LogError() << link << "exists but it's a file."; else @@ -747,7 +747,7 @@ QString copyDylib(const FrameworkInfo &framework, const QString path) } // Return if the dylib has already been deployed - if (QFileInfo(dylibDestinationBinaryPath).exists() && !alwaysOwerwriteEnabled) + if (QFileInfo::exists(dylibDestinationBinaryPath) && !alwaysOwerwriteEnabled) return dylibDestinationBinaryPath; // Copy dylib binary @@ -814,7 +814,7 @@ QString copyFramework(const FrameworkInfo &framework, const QString path) // Contents/Info.plist should be Versions/5/Resources/Info.plist const QString legacyInfoPlistPath = framework.frameworkPath + "/Contents/Info.plist"; const QString correctInfoPlistPath = frameworkDestinationDirectory + "/Resources/Info.plist"; - if (QFile(legacyInfoPlistPath).exists()) { + if (QFile::exists(legacyInfoPlistPath)) { copyFilePrintStatus(legacyInfoPlistPath, correctInfoPlistPath); patch_debugInInfoPlist(correctInfoPlistPath); } @@ -1275,11 +1275,11 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf + "/qmlimportscanner"); // Fallback: Look relative to the macdeployqt binary - if (!QFile(qmlImportScannerPath).exists()) + if (!QFile::exists(qmlImportScannerPath)) qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner"; // Verify that we found a qmlimportscanner binary - if (!QFile(qmlImportScannerPath).exists()) { + if (!QFile::exists(qmlImportScannerPath)) { LogError() << "qmlimportscanner not found at" << qmlImportScannerPath; LogError() << "Rebuild qtdeclarative/tools/qmlimportscanner"; return false; |