From f8176d72ac491469ccf0288cbb86c0ccc12fb47b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 17 Jan 2014 12:53:14 +0100 Subject: [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 --- src/qml/compiler/qqmltypecompiler.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') 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; -- cgit v1.2.3