Revert "Add QQmlBoundSignalNoParams"
[profile/ivi/qtdeclarative.git] / src / qml / qml / qqmlvme.cpp
index 2b66e00..259f618 100644 (file)
@@ -57,7 +57,6 @@
 #include "qqmlengine_p.h"
 #include "qqmlcomponent_p.h"
 #include "qqmlvmemetaobject_p.h"
-#include "qqmlbinding_p_p.h"
 #include "qqmlcontext_p.h"
 #include <private/qv4bindings_p.h>
 #include <private/qv8bindings_p.h>
@@ -66,6 +65,7 @@
 #include "qqmlscriptstring.h"
 #include "qqmlscriptstring_p.h"
 #include "qqmlpropertyvalueinterceptor_p.h"
+#include "qqmlvaluetypeproxybinding_p.h"
 
 #include <QStack>
 #include <QColor>
@@ -712,9 +712,10 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
             QMetaMethod signal = target->metaObject()->method(instr.signalIndex);
 
             QQmlBoundSignal *bs = new QQmlBoundSignal(target, signal, target);
-            QQmlExpression *expr = 
-                new QQmlExpression(CTXT, context, DATAS.at(instr.value), true, COMP->name, instr.line, instr.column, *new QQmlExpressionPrivate);
+            QQmlBoundSignalExpression *expr =
+                new QQmlBoundSignalExpression(CTXT, context, DATAS.at(instr.value), true, COMP->name, instr.line, instr.column);
             bs->setExpression(expr);
+            bs->addToObject();
         QML_END_INSTR(StoreSignal)
 
         QML_BEGIN_INSTR(StoreImportedScript)
@@ -764,42 +765,28 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
                 QML_NEXT_INSTR(StoreBinding);
 
             QQmlBinding *bind = new QQmlBinding(PRIMITIVES.at(instr.value), true, 
-                                                                context, CTXT, COMP->name, instr.line,
-                                                                instr.column);
+                                                context, CTXT, COMP->name, instr.line,
+                                                instr.column);
             bindValues.push(bind);
             bind->m_mePtr = &bindValues.top();
             bind->setTarget(target, instr.property, CTXT);
 
-            typedef QQmlPropertyPrivate QDPP;
-            Q_ASSERT(bind->propertyIndex() == QDPP::bindingIndex(instr.property));
-            Q_ASSERT(bind->object() == target);
+            if (instr.isAlias) {
+                QQmlAbstractBinding *old =
+                    QQmlPropertyPrivate::setBindingNoEnable(target,
+                                                            instr.property.coreIndex,
+                                                            instr.property.getValueTypeCoreIndex(),
+                                                            bind);
+                if (old) { old->destroy(); }
+            } else {
+                typedef QQmlPropertyPrivate QDPP;
+                Q_ASSERT(bind->propertyIndex() == QDPP::bindingIndex(instr.property));
+                Q_ASSERT(bind->object() == target);
 
-            bind->addToObject();
+                bind->addToObject();
+            }
         QML_END_INSTR(StoreBinding)
 
-        QML_BEGIN_INSTR(StoreBindingOnAlias)
-            QObject *target = 
-                objects.at(objects.count() - 1 - instr.owner);
-            QObject *context = 
-                objects.at(objects.count() - 1 - instr.context);
-
-            if (instr.isRoot && BINDINGSKIPLIST.testBit(instr.property.coreIndex))
-                QML_NEXT_INSTR(StoreBindingOnAlias);
-
-            QQmlBinding *bind = new QQmlBinding(PRIMITIVES.at(instr.value), true,
-                                                                context, CTXT, COMP->name, instr.line,
-                                                                instr.column);
-            bindValues.push(bind);
-            bind->m_mePtr = &bindValues.top();
-            bind->setTarget(target, instr.property, CTXT);
-
-            QQmlAbstractBinding *old =
-                QQmlPropertyPrivate::setBindingNoEnable(target, instr.property.coreIndex,
-                                                                instr.property.getValueTypeCoreIndex(),
-                                                                bind);
-            if (old) { old->destroy(); }
-        QML_END_INSTR(StoreBindingOnAlias)
-
         QML_BEGIN_INSTR(StoreV4Binding)
             QObject *target = 
                 objects.at(objects.count() - 1 - instr.owner);
@@ -816,7 +803,7 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
             bindValues.push(binding);
             binding->m_mePtr = &bindValues.top();
 
-            Q_ASSERT(binding->propertyIndex() == property);
+            Q_ASSERT(binding->propertyIndex() == (property & 0xFF00FFFF));
             Q_ASSERT(binding->object() == target);
 
             binding->addToObject();
@@ -837,11 +824,20 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
                 bindValues.push(binding);
                 binding->m_mePtr = &bindValues.top();
 
-                typedef QQmlPropertyPrivate QDPP;
-                Q_ASSERT(binding->propertyIndex() == QDPP::bindingIndex(instr.property));
-                Q_ASSERT(binding->object() == target);
+                if (instr.isAlias) {
+                    QQmlAbstractBinding *old =
+                        QQmlPropertyPrivate::setBindingNoEnable(target,
+                                                                instr.property.coreIndex,
+                                                                instr.property.getValueTypeCoreIndex(),
+                                                                binding);
+                    if (old) { old->destroy(); }
+                } else {
+                    typedef QQmlPropertyPrivate QDPP;
+                    Q_ASSERT(binding->propertyIndex() == QDPP::bindingIndex(instr.property));
+                    Q_ASSERT(binding->object() == target);
 
-                binding->addToObject();
+                    binding->addToObject();
+                }
             }
         QML_END_INSTR(StoreV8Binding)