summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-09-28 14:21:46 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-09-28 14:23:33 (GMT)
commit86f5a63b01844125fb4a4e5adc23d6539dd8564e (patch)
treea065555c822e08e5205c2d0a2fdad8d2f2aa637c
parentbce856612cfdd41915c4e8702be78833b3a94e33 (diff)
downloadQt-86f5a63b01844125fb4a4e5adc23d6539dd8564e.zip
Qt-86f5a63b01844125fb4a4e5adc23d6539dd8564e.tar.gz
Qt-86f5a63b01844125fb4a4e5adc23d6539dd8564e.tar.bz2
Refactor of timer verification in QAbstractAnimation
Reviewed-by: thierry
-rw-r--r--src/corelib/animation/qabstractanimation.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 6489cdc..b585fe3 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -194,12 +194,6 @@ QUnifiedTimer *QUnifiedTimer::instance()
void QUnifiedTimer::timerEvent(QTimerEvent *event)
{
- //this is simply the time we last received a tick
- const int oldLastTick = lastTick;
- if (time.isValid())
- lastTick = consistentTiming ? oldLastTick + timingInterval : time.elapsed();
-
-
if (event->timerId() == startStopAnimationTimer.timerId()) {
startStopAnimationTimer.stop();
//we transfer the waiting animations into the "really running" state
@@ -214,6 +208,10 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event)
time.start();
}
} else if (event->timerId() == animationTimer.timerId()) {
+ //this is simply the time we last received a tick
+ const int oldLastTick = lastTick;
+ lastTick = consistentTiming ? oldLastTick + timingInterval : time.elapsed();
+
//we make sure we only call update time if the time has actually changed
//it might happen in some cases that the time doesn't change because events are delayed
//when the CPU load is high