diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-23 15:20:29 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-24 14:08:23 +0000 |
commit | a6814650232825663f33fe4f11a362c397385350 (patch) | |
tree | c11b6b5365b2f0bcce494438257bbf14213a614b /src/qml/qml/qqmlobjectcreator.cpp | |
parent | 6f4c8ff34526c62995f98c804ab2b7113ff4c6b8 (diff) |
Get rid of QQmlVMEMetaData
It is unused now and we can remove it as well as its QByteArray based storage.
The non-emptyness of the meta-data QByteArray was also used to indicate whether
it is necessary to create a VME meta-object when instantiating an object. This
bit is now folded into the flag of the QFlagPointer storing the property
caches.
Change-Id: I3c3604c61ff16a4e76912e68b1c19afdb0f2bd9d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 775f8a9294..86693af3d3 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -74,7 +74,6 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QQmlCompile , compiledData(compiledData) , resolvedTypes(compiledData->resolvedTypes) , propertyCaches(compiledData->propertyCaches) - , vmeMetaObjectData(compiledData->metaObjects) , activeVMEDataForRootContext(activeVMEDataForRootContext) { init(parentContext); @@ -99,7 +98,6 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QQmlCompile , compiledData(compiledData) , resolvedTypes(compiledData->resolvedTypes) , propertyCaches(compiledData->propertyCaches) - , vmeMetaObjectData(compiledData->metaObjects) , activeVMEDataForRootContext(0) { init(parentContext); @@ -1152,7 +1150,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo return instance; } - QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(index); + QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(index).data(); Q_ASSERT(!cache.isNull()); if (installPropertyCache) { if (ddata->propertyCache) @@ -1283,14 +1281,14 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject * QV4::Scope valueScope(v4); QV4::ScopedValue scopeObjectProtector(valueScope); - QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(_compiledObjectIndex); + QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(_compiledObjectIndex).data(); QQmlVMEMetaObject *vmeMetaObject = 0; - const QByteArray data = vmeMetaObjectData.value(_compiledObjectIndex); - if (!data.isEmpty()) { + const bool needVMEMetaObject = propertyCaches.at(_compiledObjectIndex).flag(); + if (needVMEMetaObject) { Q_ASSERT(!cache.isNull()); // install on _object - vmeMetaObject = new QQmlVMEMetaObject(_qobject, cache, reinterpret_cast<const QQmlVMEMetaData*>(data.constData()), compiledData->compilationUnit, _compiledObjectIndex); + vmeMetaObject = new QQmlVMEMetaObject(_qobject, cache, compiledData->compilationUnit, _compiledObjectIndex); if (_ddata->propertyCache) _ddata->propertyCache->release(); _ddata->propertyCache = cache; |