diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-26 16:15:23 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-27 09:24:40 +0100 |
commit | bffcb953e1a824156f6021b33a3aa5de3afb56ac (patch) | |
tree | c4782f76347fde27171cb89d363c6125aaa679ea | |
parent | 3eb705b092bed98b354025ef975e3e4a77c33e76 (diff) |
qqmlmetatypemodule: Fix maximumMinorVersion() returning bad values
maximumMinorVersion() needs to ignore unspecified values as they are not
versions in themselves.
Change-Id: I7c91cf4b8320fd6636eb1be10b069cf885797ee1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 3 | ||||
-rw-r--r-- | src/qml/qml/qqmltypemodule.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 0a58ee9652..ba7ffe2a91 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -770,7 +770,8 @@ void QQmlMetaType::registerModule(const char *uri, QTypeRevision version) QQmlTypeModule *module = getTypeModule(QString::fromUtf8(uri), version, data); Q_ASSERT(module); - module->addMinorVersion(version.minorVersion()); + if (version.hasMinorVersion()) + module->addMinorVersion(version.minorVersion()); } int QQmlMetaType::typeId(const char *uri, QTypeRevision version, const char *qmlName) diff --git a/src/qml/qml/qqmltypemodule.cpp b/src/qml/qml/qqmltypemodule.cpp index 01de024deb..5120728031 100644 --- a/src/qml/qml/qqmltypemodule.cpp +++ b/src/qml/qml/qqmltypemodule.cpp @@ -61,7 +61,9 @@ void QQmlTypeModule::addMinorVersion(quint8 version) void QQmlTypeModule::add(QQmlTypePrivate *type) { QMutexLocker lock(&m_mutex); - addMinorVersion(type->version.minorVersion()); + + if (type->version.hasMinorVersion()) + addMinorVersion(type->version.minorVersion()); QList<QQmlTypePrivate *> &list = m_typeHash[type->elementName]; for (int ii = 0; ii < list.count(); ++ii) { |