summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-17 12:53:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 11:49:44 +0100
commitf8176d72ac491469ccf0288cbb86c0ccc12fb47b (patch)
treefca6769dfc90658b20cd4e50f687d967719ec5c2 /src
parent65a02ef32f7131f5e0b87dd18b4f81486d507ae3 (diff)
[new compiler] Fix type versioning
Imported types with a meta object that contains revisioned attributes, need their property cache created for exactly the imported version. So this is done ahead of type and populated in the resolved types, similar to the old code path in qqmlcompiler.cpp. Change-Id: I65a5d140d8f49cceeeee1162ab2d6376ad9c2e42 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index 4fe3008003..a684ebd959 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -87,6 +87,20 @@ bool QQmlTypeCompiler::compile()
} else {
ref->type = resolvedType->type;
Q_ASSERT(ref->type);
+ if (ref->type->containsRevisionedAttributes()) {
+ QQmlError cacheError;
+ ref->typePropertyCache = engine->cache(ref->type,
+ resolvedType->minorVersion,
+ cacheError);
+ if (!ref->typePropertyCache) {
+ cacheError.setColumn(resolvedType->location.column);
+ cacheError.setLine(resolvedType->location.line);
+ recordError(cacheError);
+ delete ref;
+ return false;
+ }
+ ref->typePropertyCache->addref();
+ }
}
ref->majorVersion = resolvedType->majorVersion;
ref->minorVersion = resolvedType->minorVersion;