aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-09 12:36:29 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-18 14:59:55 +0200
commit34c80149602c1ca52b541cd1adb67b9a1abfd5da (patch)
treea74fe9bb7a84eaaba1ae7036a36b55fcda166b8c /src/qml/qml/qqmlmetatype_p.h
parentd46c406cc67f12e6a0798ef509abbb973b34d39d (diff)
Lock all type modules of the same URI when importing a plugin
A plugin may provide multiple versions of the same types. If we don't lock them all, a further plugin may later mess with the ones we didn't lock. The code clearly attempts to prevent such a situation. Of course, a plugin may still register types under a wholly different URI, and sidestep this mechanism. However, in contrast to exposing multiple major versions from the same plugin, this is not recommended. Change-Id: Ib8d8bbeec8e738020c6d07aedcc4664157b80dcf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype_p.h')
-rw-r--r--src/qml/qml/qqmlmetatype_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index dbc0851ad6..1c00d65b75 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -96,7 +96,8 @@ public:
static CompositeMetaTypeIds registerInternalCompositeType(const QByteArray &className);
static void unregisterInternalCompositeType(const CompositeMetaTypeIds &typeIds);
static void registerModule(const char *uri, QTypeRevision version);
- static bool protectModule(const QString &uri, QTypeRevision version);
+ static bool protectModule(const QString &uri, QTypeRevision version,
+ bool protectAllVersions = false);
static void registerModuleImport(const QString &uri, QTypeRevision version, const QString &import);
static void unregisterModuleImport(const QString &uri, QTypeRevision version, const QString &import);