summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-02 00:04:35 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-05 02:40:45 (GMT)
commit15498e4c5990e934e5f2a3ee27f71c020e277e56 (patch)
tree6894ee5e0778c6598a681c23b87ede1a77db629c /src
parent02a248c9c57714d4ad1ba775d9e60a7f286f10c6 (diff)
downloadQt-15498e4c5990e934e5f2a3ee27f71c020e277e56.zip
Qt-15498e4c5990e934e5f2a3ee27f71c020e277e56.tar.gz
Qt-15498e4c5990e934e5f2a3ee27f71c020e277e56.tar.bz2
Only start timer if it isn't already active
Diffstat (limited to 'src')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 6bbd801..4c68ee7 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -231,7 +231,8 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation)
Q_ASSERT(!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer);
QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer = true;
animationsToStart << animation;
- startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this);
+ if (!startStopAnimationTimer.isActive())
+ startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this);
}
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
@@ -250,7 +251,8 @@ void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
} else {
animationsToStart.removeOne(animation);
}
- QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer = false;
+ if (!startStopAnimationTimer.isActive())
+ startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this);
}
void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)