Ignore local and non-filesystem qml imports.
authorMorten Johan Sørvig <morten.sorvig@digia.com>
Wed, 23 Apr 2014 14:06:46 +0000 (16:06 +0200)
committerMorten Johan Sørvig <morten.sorvig@digia.com>
Thu, 3 Jul 2014 07:51:04 +0000 (09:51 +0200)
Make macdeplpoyqt deploy qml imports from Qml2ImportsPath
only. js and local imports should be deployed as a
part of the application build. Remote (network) imports
should be loaded at run-time.

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

index 722f1be..bf93898 100644 (file)
@@ -716,6 +716,24 @@ void deployQmlImports(const QString &appBundlePath, QStringList &qmlDirs)
         QJsonObject import = importValue.toObject();
         QString name = import["name"].toString();
         QString path = import["path"].toString();
+        QString type = import["type"].toString();
+
+        LogNormal() << "Deploying QML import" << name;
+
+        // Skip imports with missing info - path will be empty if the import is not found.
+        if (name.isEmpty() || path.isEmpty()) {
+            LogNormal() << "  Skip import: name or path is empty";
+            LogNormal() << "";
+            continue;
+        }
+
+        // Deploy module imports only, skip directory (local/remote) and js imports. These
+        // should be deployed as a part of the application build.
+        if (type != QStringLiteral("module")) {
+            LogNormal() << "  Skip non-module import";
+            LogNormal() << "";
+            continue;
+        }
 
         // Create the destination path from the name
         // and version (grabbed from the source path)