From: jasu Date: Tue, 11 May 2010 06:23:00 +0000 (+0300) Subject: Use queue time instead of local time when setting up refresh timer X-Git-Tag: v0.0.4~17 X-Git-Url: http://git.maemo.org/git/?p=evehomescreen;a=commitdiff_plain;h=3c02c197cb49fb248cf421262dc3b654287d22c8 Use queue time instead of local time when setting up refresh timer --- diff --git a/src/widget.cpp b/src/widget.cpp index 93326dc..8af1ba5 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -141,10 +141,9 @@ void Widget::onlineStateChanged(bool online) void Widget::trainingLoaded() { - QDateTime now = QDateTime::currentDateTime(); qDebug() << "Training loaded"; - if (m_training != NULL) { - int interval = 1000 * (now.secsTo(m_training->endTime) + 60); + if (m_training != NULL && m_training->training) { + int interval = 1000 * (m_training->currentTime.secsTo(m_training->endTime) + 30); qDebug() << "Timer interval" << interval; if (m_timer->isActive()) { m_timer->stop(); @@ -152,4 +151,5 @@ void Widget::trainingLoaded() m_timer->setInterval( interval ); m_timer->start(); } + update(); }