Prevent re-deploying already deployed imports.
authorMorten Johan Sørvig <morten.sorvig@digia.com>
Thu, 25 Sep 2014 06:20:01 +0000 (08:20 +0200)
committerMorten Johan Sørvig <morten.sorvig@digia.com>
Wed, 1 Oct 2014 08:52:05 +0000 (10:52 +0200)
Check if the target directory exists before copying
the import.

Change-Id: Id729f26b4b887c7a3b209aa88649eca3fc73b0ba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/macdeployqt/shared/shared.cpp

index 3e581a9..f75f68e 100644 (file)
@@ -828,6 +828,12 @@ void deployPlugins(const QString &appBundlePath, DeploymentInfo deploymentInfo,
 void deployQmlImport(const QString &appBundlePath, const QString &importSourcePath, const QString &importName)
 {
     QString importDestinationPath = appBundlePath + "/Contents/Resources/qml/" + importName;
+
+    // Skip already deployed imports. This can happen in cases like "QtQuick.Controls.Styles",
+    // where deploying QtQuick.Controls will also deploy the "Styles" sub-import.
+    if (QDir().exists(importDestinationPath))
+        return;
+
     recursiveCopyAndDeploy(appBundlePath, importSourcePath, importDestinationPath);
 }