diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-29 19:21:54 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-31 14:28:29 +0000 |
commit | 2bb309af8b2e32bd34644bed363f5880c50221af (patch) | |
tree | fe0ddd6d65840d733315c5e97c0e61a8949843c4 /src/qml/qml/qqmlcompileddata.cpp | |
parent | 7e84a8631cca6f81428ae4b2621e6858a8de9357 (diff) |
Moved resolved type references over to QV4::CompiledData::CompilationUnit
Change-Id: I99bb37bf4d4aa4aedd8e02a0fb4afb4a908573a6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcompileddata.cpp')
-rw-r--r-- | src/qml/qml/qqmlcompileddata.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp index b25792054c..fad13bb1e3 100644 --- a/src/qml/qml/qqmlcompileddata.cpp +++ b/src/qml/qml/qqmlcompileddata.cpp @@ -74,71 +74,12 @@ QQmlCompiledData::~QQmlCompiledData() QQmlEnginePrivate::get(engine)->unregisterInternalCompositeType(this); clear(); - - for (QHash<int, TypeReference*>::Iterator resolvedType = resolvedTypes.begin(), end = resolvedTypes.end(); - resolvedType != end; ++resolvedType) { - if ((*resolvedType)->component) - (*resolvedType)->component->release(); - if ((*resolvedType)->typePropertyCache) - (*resolvedType)->typePropertyCache->release(); - } - qDeleteAll(resolvedTypes); - resolvedTypes.clear(); } void QQmlCompiledData::clear() { } -/*! -Returns the property cache, if one alread exists. The cache is not referenced. -*/ -QQmlPropertyCache *QQmlCompiledData::TypeReference::propertyCache() const -{ - if (type) - return typePropertyCache; - else - return component->compilationUnit->rootPropertyCache(); -} - -/*! -Returns the property cache, creating one if it doesn't already exist. The cache is not referenced. -*/ -QQmlPropertyCache *QQmlCompiledData::TypeReference::createPropertyCache(QQmlEngine *engine) -{ - if (typePropertyCache) { - return typePropertyCache; - } else if (type) { - typePropertyCache = QQmlEnginePrivate::get(engine)->cache(type->metaObject()); - typePropertyCache->addref(); - return typePropertyCache; - } else { - return component->compilationUnit->rootPropertyCache(); - } -} - -template <typename T> -bool qtTypeInherits(const QMetaObject *mo) { - while (mo) { - if (mo == &T::staticMetaObject) - return true; - mo = mo->superClass(); - } - return false; -} - -void QQmlCompiledData::TypeReference::doDynamicTypeCheck() -{ - const QMetaObject *mo = 0; - if (typePropertyCache) - mo = typePropertyCache->firstCppMetaObject(); - else if (type) - mo = type->metaObject(); - else if (component) - mo = component->compilationUnit->rootPropertyCache()->firstCppMetaObject(); - isFullyDynamicType = qtTypeInherits<QQmlPropertyMap>(mo); -} - void QQmlCompiledData::initialize(QQmlEngine *engine) { Q_ASSERT(!hasEngine()); |