aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-04-04 12:19:06 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-04 13:29:13 +0200
commit03a6db7fc17355d4478da05891860df6c0eb1560 (patch)
treebc616f10ae862d24bd73274aad96b950ca64179c /src/qml/qml/qqmlvme.cpp
parent62e88faeb4ec8b3ad6209cadd2d3e5dcc3b4217e (diff)
Revert "Do not execute overwritten bindings"
This reverts commit 639208cc7f3ab3d8356363559e8fcf168e32cf0b. There were two problems with this submit: 1. Maintaining a hash of all the properties we have assigned bindings to is massively inefficient. 2. The autotest was in the qquickbinding testcase which is for the QtQuick "Binding" element, not for generic binding tests. Change-Id: Id2150dbfe86c6844cc0b115d7f941ae8d6a60643 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r--src/qml/qml/qqmlvme.cpp48
1 files changed, 9 insertions, 39 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 5534583dfa..f5a695456f 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -79,16 +79,8 @@
#include <QtCore/qvarlengtharray.h>
#include <QtQml/qjsvalue.h>
-#include <utility>
-
QT_BEGIN_NAMESPACE
-template <typename T1, typename T2>
-uint qHash(const std::pair<T1, T2> &p)
-{
- return qHash(p.first) ^ qHash(p.second);
-}
-
using namespace QQmlVMETypes;
#define VME_EXCEPTION(desc, line) \
@@ -1224,40 +1216,18 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt)
{
QQmlTrace trace("VME Binding Enable");
trace.event("begin binding eval");
+ while (!bindValues.isEmpty()) {
+ QQmlAbstractBinding *b = bindValues.pop();
- size_t bindValuesRemaining = bindValues.count();
- if (bindValuesRemaining > 0) {
- typedef std::pair<QObject *, int> TargetProperty;
-
- QSet<TargetProperty> boundProperties;
- boundProperties.reserve(bindValuesRemaining - 1);
-
- while (bindValuesRemaining > 0) {
- QQmlAbstractBinding *b = bindValues.pop();
- --bindValuesRemaining;
-
- if (b) {
- b->m_mePtr = 0;
-
- TargetProperty property(std::make_pair(b->object(), b->propertyIndex()));
- if (!boundProperties.contains(property)) {
- // We have not assigned a binding to this property yet
- b->setEnabled(true, QQmlPropertyPrivate::BypassInterceptor |
- QQmlPropertyPrivate::DontRemoveBinding);
-
- if (bindValuesRemaining > 0) {
- boundProperties.insert(property);
- }
- } else {
- b->destroy();
- }
- }
-
- if (watcher.hasRecursed() || interrupt.shouldInterrupt())
- return 0;
+ if (b) {
+ b->m_mePtr = 0;
+ b->setEnabled(true, QQmlPropertyPrivate::BypassInterceptor |
+ QQmlPropertyPrivate::DontRemoveBinding);
}
- }
+ if (watcher.hasRecursed() || interrupt.shouldInterrupt())
+ return 0;
+ }
bindValues.deallocate();
}