From: jasu Date: Sun, 23 May 2010 10:16:25 +0000 (+0300) Subject: check that last update is later than now X-Git-Tag: v0.0.4~1 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=0a4d9659cd33e71a79dcb1c5222a8b8598f325ec;p=evehomescreen check that last update is later than now --- diff --git a/src/widget.cpp b/src/widget.cpp index a6694fd..0f41be0 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -174,10 +174,12 @@ void Widget::trainingLoaded() m_updateTimer->stop(); QDateTime nextUpdate = m_training->lastTraining().endTime; - nextUpdate.addSecs(-1*60*60*24); - m_updateTimer->setInterval(1000 * (m_training->currentTime.secsTo(nextUpdate) + 15)); - m_updateTimer->start(); + nextUpdate.addSecs(-1*60*60*24); + if (nextUpdate > m_training->currentTime) { + m_updateTimer->setInterval(1000 * (m_training->currentTime.secsTo(nextUpdate) + 15)); + m_updateTimer->start(); + } } update(); }