From 5f7f4a583fdaf7b2ae1a71d8bdd1a0beb290f1c3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 13 Dec 2013 11:18:00 +0200 Subject: [PATCH] windeployqt: Concatenate qmlimportscanner results. Fix up f5b851f83cfb315bbc87ef878bde0b2573f225cf introducing multiple values for the -qmldir option. Change-Id: Ib199105776d42b6eaa81003ed5682b2272a19a53 Reviewed-by: Oliver Wolff --- src/windeployqt/main.cpp | 5 +++-- src/windeployqt/qmlutils.cpp | 12 ++++++++++++ src/windeployqt/qmlutils.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp index b3b1e9a..c53ba48 100644 --- a/src/windeployqt/main.cpp +++ b/src/windeployqt/main.cpp @@ -735,9 +735,10 @@ static DeployResult deploy(const Options &options, foreach (const QString &qmlDirectory, qmlDirectories) { if (optVerboseLevel >= 1) std::printf("Scanning %s:\n", qPrintable(QDir::toNativeSeparators(qmlDirectory))); - qmlScanResult = runQmlImportScanner(qmlDirectory, qmakeVariables.value(QStringLiteral("QT_INSTALL_QML")), options.platform, isDebug, errorMessage); - if (!qmlScanResult.ok) + const QmlImportScanResult scanResult = runQmlImportScanner(qmlDirectory, qmakeVariables.value(QStringLiteral("QT_INSTALL_QML")), options.platform, isDebug, errorMessage); + if (!scanResult.ok) return result; + qmlScanResult.append(scanResult); // Additional dependencies of QML plugins. foreach (const QString &plugin, qmlScanResult.plugins) { if (!findDependentQtLibraries(libraryLocation, plugin, options.platform, errorMessage, &dependentQtLibs, &wordSize, &isDebug)) diff --git a/src/windeployqt/qmlutils.cpp b/src/windeployqt/qmlutils.cpp index 2a41f8a..8e16a95 100644 --- a/src/windeployqt/qmlutils.cpp +++ b/src/windeployqt/qmlutils.cpp @@ -128,4 +128,16 @@ QmlImportScanResult runQmlImportScanner(const QString &directory, const QString return result; } +void QmlImportScanResult::append(const QmlImportScanResult &other) +{ + foreach (const QString &module, other.modulesDirectories) { + if (!modulesDirectories.contains(module)) + modulesDirectories.append(module); + } + foreach (const QString &plugin, other.plugins) { + if (!plugin.contains(plugin)) + plugins.append(plugin); + } +} + QT_END_NAMESPACE diff --git a/src/windeployqt/qmlutils.h b/src/windeployqt/qmlutils.h index 0d7c6cc..ea8c774 100644 --- a/src/windeployqt/qmlutils.h +++ b/src/windeployqt/qmlutils.h @@ -50,6 +50,7 @@ QString findQmlDirectory(int platform, const QString &startDirectoryName); struct QmlImportScanResult { QmlImportScanResult() : ok(false) {} + void append(const QmlImportScanResult &other); bool ok; QStringList modulesDirectories; -- 2.7.4