macdeployqt: Use static QFile::exists()

This commit is contained in:
Jonas Kvinge
2021-10-30 19:23:08 +02:00
parent 1223469be9
commit 9fbecb5af6
2 changed files with 7 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ int main(int argc, char **argv)
appBundlePath = QDir::cleanPath(appBundlePath); appBundlePath = QDir::cleanPath(appBundlePath);
if (QDir().exists(appBundlePath) == false) { if (!QDir(appBundlePath).exists()) {
qDebug() << "Error: Could not find app bundle" << appBundlePath; qDebug() << "Error: Could not find app bundle" << appBundlePath;
return 1; return 1;
} }

View File

@@ -104,7 +104,7 @@ inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info)
bool copyFilePrintStatus(const QString &from, const QString &to) bool copyFilePrintStatus(const QString &from, const QString &to)
{ {
if (QFile(to).exists()) { if (QFile::exists(to)) {
if (alwaysOwerwriteEnabled) { if (alwaysOwerwriteEnabled) {
QFile(to).remove(); QFile(to).remove();
} else { } else {
@@ -141,7 +141,7 @@ bool copyFilePrintStatus(const QString &from, const QString &to)
bool linkFilePrintStatus(const QString &file, const QString &link) bool linkFilePrintStatus(const QString &file, const QString &link)
{ {
if (QFile(link).exists()) { if (QFile::exists(link)) {
if (QFile(link).symLinkTarget().isEmpty()) if (QFile(link).symLinkTarget().isEmpty())
LogError() << link << "exists but it's a file."; LogError() << link << "exists but it's a file.";
else else
@@ -754,7 +754,7 @@ QString copyDylib(const FrameworkInfo &framework, const QString path)
} }
// Return if the dylib has already been deployed // Return if the dylib has already been deployed
if (QFileInfo(dylibDestinationBinaryPath).exists() && !alwaysOwerwriteEnabled) if (QFileInfo::exists(dylibDestinationBinaryPath) && !alwaysOwerwriteEnabled)
return dylibDestinationBinaryPath; return dylibDestinationBinaryPath;
// Copy dylib binary // Copy dylib binary
@@ -821,7 +821,7 @@ QString copyFramework(const FrameworkInfo &framework, const QString path)
// Contents/Info.plist should be Versions/5/Resources/Info.plist // Contents/Info.plist should be Versions/5/Resources/Info.plist
const QString legacyInfoPlistPath = framework.frameworkPath + "/Contents/Info.plist"; const QString legacyInfoPlistPath = framework.frameworkPath + "/Contents/Info.plist";
const QString correctInfoPlistPath = frameworkDestinationDirectory + "/Resources/Info.plist"; const QString correctInfoPlistPath = frameworkDestinationDirectory + "/Resources/Info.plist";
if (QFile(legacyInfoPlistPath).exists()) { if (QFile::exists(legacyInfoPlistPath)) {
copyFilePrintStatus(legacyInfoPlistPath, correctInfoPlistPath); copyFilePrintStatus(legacyInfoPlistPath, correctInfoPlistPath);
patch_debugInInfoPlist(correctInfoPlistPath); patch_debugInInfoPlist(correctInfoPlistPath);
} }
@@ -1443,11 +1443,11 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
#endif #endif
// Fallback: Look relative to the macdeployqt binary // Fallback: Look relative to the macdeployqt binary
if (!QFile(qmlImportScannerPath).exists()) if (!QFile::exists(qmlImportScannerPath))
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner"; qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
// Verify that we found a qmlimportscanner binary // Verify that we found a qmlimportscanner binary
if (!QFile(qmlImportScannerPath).exists()) { if (!QFile::exists(qmlImportScannerPath)) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath; LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
LogError() << "Rebuild qtdeclarative/tools/qmlimportscanner"; LogError() << "Rebuild qtdeclarative/tools/qmlimportscanner";
return false; return false;