diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-17 13:18:10 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-17 11:52:57 +0000 |
commit | 181e45964dda281c456db3d3315d53782f918962 (patch) | |
tree | a6986589b1b4e3f48d9f3407cedbcdd2db5a0379 | |
parent | b6735d4519be3d551c6dd5074615c058570df872 (diff) | |
download | qttools-181e45964dda281c456db3d3315d53782f918962.tar.gz |
windeployqt: Fall back comparing names of QML modules when their class name is empty
QtWebEngine and some other modules have empty class names, so they are
dropped when concatenating QML imports.
Task-number: QTBUG-61957
Change-Id: I06ccf8ab54b2d3ffba04f15746722f5b3596d5d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | src/windeployqt/qmlutils.cpp | 16 | ||||
-rw-r--r-- | src/windeployqt/qmlutils.h | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/windeployqt/qmlutils.cpp b/src/windeployqt/qmlutils.cpp index 9e8bb09e2..52f044068 100644 --- a/src/windeployqt/qmlutils.cpp +++ b/src/windeployqt/qmlutils.cpp @@ -39,6 +39,11 @@ QT_BEGIN_NAMESPACE +bool operator==(const QmlImportScanResult::Module &m1, const QmlImportScanResult::Module &m2) +{ + return m1.className.isEmpty() ? m1.name == m2.name : m1.className == m2.className; +} + // Return install path (cp -r semantics) QString QmlImportScanResult::Module::installPath(const QString &root) const { @@ -153,19 +158,10 @@ QmlImportScanResult runQmlImportScanner(const QString &directory, const QString return result; } -static inline bool contains(const QList<QmlImportScanResult::Module> &modules, const QString &className) -{ - for (const QmlImportScanResult::Module &m : modules) { - if (m.className == className) - return true; - } - return false; -} - void QmlImportScanResult::append(const QmlImportScanResult &other) { for (const QmlImportScanResult::Module &module : other.modules) { - if (!contains(modules, module.className)) + if (std::find(modules.cbegin(), modules.cend(), module) == modules.cend()) modules.append(module); } for (const QString &plugin : other.plugins) { diff --git a/src/windeployqt/qmlutils.h b/src/windeployqt/qmlutils.h index 5e1ddc619..895c7f1de 100644 --- a/src/windeployqt/qmlutils.h +++ b/src/windeployqt/qmlutils.h @@ -55,6 +55,8 @@ struct QmlImportScanResult { QStringList plugins; }; +bool operator==(const QmlImportScanResult::Module &m1, const QmlImportScanResult::Module &m2); + QmlImportScanResult runQmlImportScanner(const QString &directory, const QString &qmlImportPath, bool usesWidgets, int platform, DebugMatchMode debugMatchMode, QString *errorMessage); |