diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-27 11:36:43 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-31 17:08:57 +0000 |
commit | 77449db6e086e8ac6594c432fede027656be0da0 (patch) | |
tree | 7bc9daff55d4480148488030f797ed517233736e /src/qml/compiler/qqmlpropertyvalidator.cpp | |
parent | 71c66d4b41be95b44ffa0d9bbbf04164f74bd23a (diff) |
Encapsulate access to CompiledData::Object and CompiledData::Import
This will make it easier to move the data out of CompiledData::Unit and
into a separate data structure.
Change-Id: I32e6233a66f2279b44cc06ef7c3505db4a565f98
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlpropertyvalidator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlpropertyvalidator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp index 99bd525d47..4cb922ca8d 100644 --- a/src/qml/compiler/qqmlpropertyvalidator.cpp +++ b/src/qml/compiler/qqmlpropertyvalidator.cpp @@ -54,7 +54,7 @@ QQmlPropertyValidator::QQmlPropertyValidator(QQmlEnginePrivate *enginePrivate, c , propertyCaches(compilationUnit->propertyCaches) , bindingPropertyDataPerObject(&compilationUnit->bindingPropertyDataPerObject) { - bindingPropertyDataPerObject->resize(qmlUnit->nObjects); + bindingPropertyDataPerObject->resize(compilationUnit->objectCount()); } QVector<QQmlCompileError> QQmlPropertyValidator::validate() @@ -82,7 +82,7 @@ struct BindingFinder QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledData::Binding *instantiatingBinding, bool populatingValueTypeGroupProperty) const { - const QV4::CompiledData::Object *obj = qmlUnit->objectAt(objectIndex); + const QV4::CompiledData::Object *obj = compilationUnit->objectAt(objectIndex); if (obj->flags & QV4::CompiledData::Object::IsComponent) { Q_ASSERT(obj->nBindings == 1); @@ -628,7 +628,7 @@ QQmlCompileError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData * bool isValueSource = false; bool isPropertyInterceptor = false; - const QV4::CompiledData::Object *targetObject = qmlUnit->objectAt(binding->value.objectIndex); + const QV4::CompiledData::Object *targetObject = compilationUnit->objectAt(binding->value.objectIndex); if (auto *typeRef = resolvedTypes.value(targetObject->inheritedTypeNameIndex)) { QQmlRefPointer<QQmlPropertyCache> cache = typeRef->createPropertyCache(QQmlEnginePrivate::get(enginePrivate)); const QMetaObject *mo = cache->firstCppMetaObject(); @@ -666,7 +666,7 @@ QQmlCompileError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData * } } return noError; - } else if (qmlUnit->objectAt(binding->value.objectIndex)->flags & QV4::CompiledData::Object::IsComponent) { + } else if (compilationUnit->objectAt(binding->value.objectIndex)->flags & QV4::CompiledData::Object::IsComponent) { return noError; } else if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerObject && property->isFunction()) { return noError; @@ -694,7 +694,7 @@ QQmlCompileError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData * if (!isAssignable) { return QQmlCompileError(binding->valueLocation, tr("Cannot assign object of type \"%1\" to property of type \"%2\" as the former is neither the same as the latter nor a sub-class of it.") - .arg(stringAt(qmlUnit->objectAt(binding->value.objectIndex)->inheritedTypeNameIndex)).arg(QLatin1String(QMetaType::typeName(property->propType())))); + .arg(stringAt(compilationUnit->objectAt(binding->value.objectIndex)->inheritedTypeNameIndex)).arg(QLatin1String(QMetaType::typeName(property->propType())))); } } return noError; |