From 37139c96f04f781b053feefdbb5b3d28b2bcfc11 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Thu, 4 Apr 2013 23:37:52 +0200 Subject: fix timezones on real device --- forummodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'forummodel.cpp') diff --git a/forummodel.cpp b/forummodel.cpp index 7606f93..aecb8c2 100644 --- a/forummodel.cpp +++ b/forummodel.cpp @@ -125,7 +125,7 @@ void ForumModel::fetchMore(const QModelIndex &parent) if (!topics.empty()) { QDateTime last = oldestPostUpdate(topics); // If the topics we got from DB are too old, refresh online. - if (last.secsTo(QDateTime::currentDateTime()) > FORUM_TOPICS_TLL) { + if (last.secsTo(QDateTime::currentDateTimeUtc()) > FORUM_TOPICS_TLL) { qDebug() << "Fetching topics because of old"; Q_ASSERT(new_end > 0); _board->enqueueAction(new FetchTopicsAction(_forumId, @@ -163,7 +163,7 @@ QDateTime ForumModel::parseDateTime(const QVariant &v) QDateTime ForumModel::oldestPostUpdate(const QList &topics) { - if (topics.empty()) return QDateTime::currentDateTime(); + if (topics.empty()) return QDateTime::currentDateTimeUtc(); QDateTime min = topics.first().last_update_time; foreach (const Topic& topic, topics) { if (min < topic.last_update_time) min = topic.last_update_time; @@ -299,7 +299,7 @@ void ForumModel::update() if (!_board->service()->isAccessible()) return; QDateTime last = lastTopPostUpdate(); if (!last.isValid() || - last.secsTo(QDateTime::currentDateTime()) > FORUM_TOP_TLL) { + last.secsTo(QDateTime::currentDateTimeUtc()) > FORUM_TOP_TLL) { // Outdated or empty, refresh. qDebug() << "Fetching topics because the top are old"; _board->enqueueAction(new FetchTopicsAction(_forumId, 0, FORUM_PAGE_SIZE - 1, _board)); -- cgit v1.2.3