From 0a4d9659cd33e71a79dcb1c5222a8b8598f325ec Mon Sep 17 00:00:00 2001 From: jasu Date: Sun, 23 May 2010 13:16:25 +0300 Subject: [PATCH] check that last update is later than now --- src/widget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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(); } -- 1.7.9.5