diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-21 08:47:36 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-21 08:47:36 (GMT) |
commit | 5861eec545692ad1b6df00dde28ad044cfe1477b (patch) | |
tree | 18c1ef9e06337149f56a12c5d13419a8225f9178 | |
parent | cf7a6fee7af112ca3d6e4c511417b9e42cfc6716 (diff) | |
download | Qt-5861eec545692ad1b6df00dde28ad044cfe1477b.zip Qt-5861eec545692ad1b6df00dde28ad044cfe1477b.tar.gz Qt-5861eec545692ad1b6df00dde28ad044cfe1477b.tar.bz2 |
Improve binding optimizer's subscription logic
-rw-r--r-- | src/declarative/qml/qmlbindingvme.cpp | 11 |
1 files 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); |