From 5861eec545692ad1b6df00dde28ad044cfe1477b Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 21 Dec 2009 18:47:36 +1000 Subject: Improve binding optimizer's subscription logic --- src/declarative/qml/qmlbindingvme.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlbindingvme.cpp b/src/declarative/qml/qmlbindingvme.cpp index 2e3dcca..01c7a4b 100644 --- a/src/declarative/qml/qmlbindingvme.cpp +++ b/src/declarative/qml/qmlbindingvme.cpp @@ -409,6 +409,9 @@ static bool findproperty(QObject *obj, Register *output, QmlPropertyCache::Data *property = findproperty(obj, name, enginePriv, local); if (property) { + if (subIdx != -1) + subscribe(obj, property->notifyIndex, subIdx, config); + if (property->flags & QmlPropertyCache::Data::IsQObjectDerived) { void *args[] = { output->typeDataPtr(), 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args); @@ -444,9 +447,6 @@ static bool findproperty(QObject *obj, Register *output, } - if (subIdx != -1) - subscribe(obj, property->notifyIndex, subIdx, config); - return true; } else { return false; @@ -476,8 +476,13 @@ static bool findgeneric(Register *output, // val while (context) { int contextPropertyIndex = context->propertyNames?context->propertyNames->value(name):-1; + + if (contextPropertyIndex != -1) { + subscribe(QmlContextPrivate::get(context), contextPropertyIndex + context->notifyIndex, + subIdx, config); + if (contextPropertyIndex < context->idValueCount) { output->setQObject(context->idValues[contextPropertyIndex]); output->settype(QMetaType::QObjectStar); -- cgit v0.12