diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-05-12 01:46:15 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-05-12 01:53:02 (GMT) |
commit | 5e843ec092e2d236bd51f015b136db3fca5c10ba (patch) | |
tree | 46e6ab68ac463f31c38bf4b0339e10e3ac990fdc /src/declarative/util | |
parent | 7827b791828c3efa96143ed7a9af354883c8d926 (diff) | |
download | Qt-5e843ec092e2d236bd51f015b136db3fca5c10ba.zip Qt-5e843ec092e2d236bd51f015b136db3fca5c10ba.tar.gz Qt-5e843ec092e2d236bd51f015b136db3fca5c10ba.tar.bz2 |
Bail out early if the same target value is reassigned to a Behavior.
Task-number: QTBUG-10586
Reviewed-by: leo
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qdeclarativebehavior.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index ba90007..90e0ca3 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -62,6 +62,7 @@ public: QDeclarativeProperty property; QVariant currentValue; + QVariant targetValue; QDeclarativeGuard<QDeclarativeAbstractAnimation> animation; bool enabled; bool finalized; @@ -162,10 +163,15 @@ void QDeclarativeBehavior::write(const QVariant &value) qmlExecuteDeferred(this); if (!d->animation || !d->enabled || !d->finalized) { QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + d->targetValue = value; return; } + if (value == d->targetValue) + return; + d->currentValue = d->property.read(); + d->targetValue = value; if (d->animation->qtAnimation()->duration() != -1) d->animation->qtAnimation()->stop(); |