Use the cached property data when possible
authorAaron Kennedy <aaron.kennedy@nokia.com>
Fri, 22 Jul 2011 01:51:41 +0000 (11:51 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 30 Aug 2011 11:18:28 +0000 (13:18 +0200)
Change-Id: I6690208b9a4d99e485874c5253d69cb82938c8a6
Reviewed-on: http://codereview.qt.nokia.com/3768
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>

src/declarative/qml/qdeclarativecompiler.cpp

index bb2742c..622949c 100644 (file)
@@ -1614,7 +1614,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
 
         COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt));
 
-    } else if (enginePrivate->isList(prop->type)) {
+    } else if (prop->core.isQList()) {
 
         COMPILE_CHECK(buildListProperty(prop, obj, ctxt));
 
@@ -1668,7 +1668,7 @@ bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespac
 void QDeclarativeCompiler::genValueProperty(QDeclarativeParser::Property *prop,
                                    QDeclarativeParser::Object *obj)
 {
-    if (enginePrivate->isList(prop->type)) {
+    if (prop->core.isQList()) {
         genListProperty(prop, obj);
     } else {
         genPropertyAssignment(prop, obj);
@@ -2021,7 +2021,7 @@ bool QDeclarativeCompiler::buildListProperty(QDeclarativeParser::Property *prop,
                                              QDeclarativeParser::Object *obj,
                                              const BindingContext &ctxt)
 {
-    Q_ASSERT(enginePrivate->isList(prop->type));
+    Q_ASSERT(prop->core.isQList());
 
     int t = prop->type;
 
@@ -3011,9 +3011,7 @@ bool QDeclarativeCompiler::buildBinding(QDeclarativeParser::Value *value,
     Q_ASSERT(prop->parent);
     Q_ASSERT(prop->parent->metaObject());
 
-    // XXX aakenned
-    QMetaProperty mp = prop->parent->metaObject()->property(prop->index);
-    if (!mp.isWritable() && !QDeclarativeMetaType::isList(prop->type))
+    if (!prop->core.isWritable() && !prop->core.isQList())
         COMPILE_EXCEPTION(prop, tr("Invalid property assignment: \"%1\" is a read-only property").arg(prop->name().toString()));
 
     BindingReference *reference = pool->New<BindingReference>();