aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatypedata.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-05 15:45:01 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-02-07 17:49:52 +0000
commit1aae51242ed3902efac9524360f678113087f159 (patch)
tree07879896d7e8fc683c99b92e1e1acb50e610ae1c /src/qml/qml/qqmlmetatypedata.cpp
parent8d0b649c6b6ebf64dd4f644a5a2b3b1fa34e57c9 (diff)
Add public methods to query and set allowed revisions of property caches
We should not poke around in the private objects for this. Change-Id: If7089848d8310700a5a84efb0ff9b753a7de1f97 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatypedata.cpp')
-rw-r--r--src/qml/qml/qqmlmetatypedata.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlmetatypedata.cpp b/src/qml/qml/qqmlmetatypedata.cpp
index c5b9ae1a15..989f1adf7c 100644
--- a/src/qml/qml/qqmlmetatypedata.cpp
+++ b/src/qml/qml/qqmlmetatypedata.cpp
@@ -129,12 +129,15 @@ QQmlPropertyCache *QQmlMetaTypeData::propertyCache(const QQmlType &type, int min
int rev = currentType.metaObjectRevision();
int moIndex = types.count() - 1 - ii;
- if (raw->allowedRevisionCache[moIndex] != rev) {
+ if (raw->allowedRevision(moIndex) != rev) {
if (!hasCopied) {
+ // TODO: The copy should be mutable, and the original should be const
+ // Considering this, the setAllowedRevision() below does not violate
+ // the immutability of already published property caches.
raw = raw->copy();
hasCopied = true;
}
- raw->allowedRevisionCache[moIndex] = rev;
+ raw->setAllowedRevision(moIndex, rev);
}
}