aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-02-10 12:57:57 +0000
committerQt by Nokia <qt-info@nokia.com>2012-02-20 16:25:32 +0100
commit08566134e96971a8e8552a10ca7d6f31fca8a618 (patch)
tree32d7bbae9442ecd5f2373392fcb01c5741df470f /src/declarative/qml/v8
parent157b7452b591d854f837a00ee8715190a5991c4c (diff)
Don't store object and property in QDeclarativeAbstractBinding
Change-Id: Ia164655f6329ec80dc466a1a3a5613a73e1c23ac Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8')
-rw-r--r--src/declarative/qml/v8/qv8bindings.cpp19
-rw-r--r--src/declarative/qml/v8/qv8bindings_p.h4
2 files changed, 17 insertions, 6 deletions
diff --git a/src/declarative/qml/v8/qv8bindings.cpp b/src/declarative/qml/v8/qv8bindings.cpp
index 648e8f67b7..439ba1e1a4 100644
--- a/src/declarative/qml/v8/qv8bindings.cpp
+++ b/src/declarative/qml/v8/qv8bindings.cpp
@@ -59,7 +59,7 @@ static QDeclarativeJavaScriptExpression::VTable QV8Bindings_Binding_jsvtable = {
};
QV8Bindings::Binding::Binding()
-: QDeclarativeJavaScriptExpression(&QV8Bindings_Binding_jsvtable), object(0), parent(0)
+: QDeclarativeJavaScriptExpression(&QV8Bindings_Binding_jsvtable), target(0), parent(0)
{
}
@@ -84,6 +84,16 @@ void QV8Bindings::Binding::refresh()
update();
}
+int QV8Bindings::Binding::propertyIndex() const
+{
+ return instruction->property.encodedIndex();
+}
+
+QObject *QV8Bindings::Binding::object() const
+{
+ return target;
+}
+
void QV8Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
{
if (!enabledFlag())
@@ -120,7 +130,7 @@ void QV8Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
bool needsErrorData = false;
if (!watcher.wasDeleted() && !hasError()) {
typedef QDeclarativePropertyPrivate PP;
- needsErrorData = !PP::writeBinding(object, instruction->property, context, this, result,
+ needsErrorData = !PP::writeBinding(target, instruction->property, context, this, result,
isUndefined, flags);
}
@@ -147,7 +157,7 @@ void QV8Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
ep->dereferenceScarceResources();
} else {
- QDeclarativeProperty p = QDeclarativePropertyPrivate::restore(object, instruction->property,
+ QDeclarativeProperty p = QDeclarativePropertyPrivate::restore(target, instruction->property,
context);
QDeclarativeBindingPrivate::printBindingLoopError(p);
}
@@ -245,8 +255,7 @@ QV8Bindings::configBinding(QObject *target, QObject *scope,
QV8Bindings::Binding *rv = bindings + i->value;
rv->instruction = i;
-
- rv->object = target;
+ rv->target = target;
rv->setScopeObject(scope);
rv->setUseSharedContext(true);
rv->setNotifyOnValueChanged(true);
diff --git a/src/declarative/qml/v8/qv8bindings_p.h b/src/declarative/qml/v8/qv8bindings_p.h
index b1bb169edb..14de2d1705 100644
--- a/src/declarative/qml/v8/qv8bindings_p.h
+++ b/src/declarative/qml/v8/qv8bindings_p.h
@@ -96,8 +96,10 @@ public:
virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags);
virtual void update(QDeclarativePropertyPrivate::WriteFlags flags);
virtual void destroy();
+ virtual int propertyIndex() const;
+ virtual QObject *object() const;
- QObject *object;
+ QObject *target;
QV8Bindings *parent;
// To save memory, we store flags inside the instruction pointer.