From 5cb8ca29c3815405d41d035f5f4ebb2af326a8ef Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 7 Jan 2015 15:19:29 +0100 Subject: Allow importing protected modules with different major versions This allows QtQuick.Controls 1.x and 2.x imports to co-exist even if they are two different plugins with the same module directive. Change-Id: Idee302439e3c2fd6813ba2f41b69144fbae7902c Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlmetatype.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/qqmlmetatype.cpp') diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index d20fe72d09..00fe233124 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1391,14 +1391,14 @@ bool qmlProtectModule(const char *uri, int majVersion) return false; } -bool QQmlMetaType::namespaceContainsRegistrations(const QString &uri) +bool QQmlMetaType::namespaceContainsRegistrations(const QString &uri, int majorVersion) { QQmlMetaTypeData *data = metaTypeData(); // Has any type previously been installed to this namespace? QHashedString nameSpace(uri); foreach (const QQmlType *type, data->types) - if (type->module() == nameSpace) + if (type->module() == nameSpace && type->majorVersion() == majorVersion) return true; return false; -- cgit v1.2.3