From 86f5a63b01844125fb4a4e5adc23d6539dd8564e Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 28 Sep 2009 16:21:46 +0200 Subject: Refactor of timer verification in QAbstractAnimation Reviewed-by: thierry --- src/corelib/animation/qabstractanimation.cpp | 10 ++++------ 1 file 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 -- cgit v0.12