summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-02-21 06:11:50 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-02-22 01:12:22 (GMT)
commit5fa90e4bc83541dc23db150166157e2a3f04a668 (patch)
tree3a82d613dbd1a7c80e5fa1c30c488022c49ee31a /src/declarative/util
parent0c24787a2f35a7b0585c9dfb3bf0a8cb34ce867f (diff)
downloadQt-5fa90e4bc83541dc23db150166157e2a3f04a668.zip
Qt-5fa90e4bc83541dc23db150166157e2a3f04a668.tar.gz
Qt-5fa90e4bc83541dc23db150166157e2a3f04a668.tar.bz2
Prevent an animation from being registered to run twice.
This could cause animations to start running that could not later be stopped. Change-Id: I320f50121f3566619f08181664d049b02e2848e5 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp5
-rw-r--r--src/declarative/util/qdeclarativeanimation_p_p.h3
2 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index f22b9dd..014d368 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -182,12 +182,11 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
{
Q_D(QDeclarativeAbstractAnimation);
if (!d->componentComplete) {
- if (d->running && r == d->running) //don't re-register
- return;
d->running = r;
if (r == false)
d->avoidPropertyValueSourceStart = true;
- else {
+ else if (!d->registered) {
+ d->registered = true;
QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this));
engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()"));
}
diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h
index 84bc0ef..3c41565 100644
--- a/src/declarative/util/qdeclarativeanimation_p_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p_p.h
@@ -210,7 +210,7 @@ public:
: running(false), paused(false), alwaysRunToEnd(false),
connectedTimeLine(false), componentComplete(true),
avoidPropertyValueSourceStart(false), disableUserControl(false),
- loopCount(1), group(0) {}
+ registered(false), loopCount(1), group(0) {}
bool running:1;
bool paused:1;
@@ -219,6 +219,7 @@ public:
bool componentComplete:1;
bool avoidPropertyValueSourceStart:1;
bool disableUserControl:1;
+ bool registered:1;
int loopCount;