summaryrefslogtreecommitdiff
path: root/forummodel.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-04-04 23:37:52 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-04-04 23:37:52 +0200
commit37139c96f04f781b053feefdbb5b3d28b2bcfc11 (patch)
treec6a5bd9557a0442e6b5ad6fa3bae86803339cf32 /forummodel.cpp
parent3f3a98b7e49230aabd0e557ea59e89e20537ca8a (diff)
downloadtapasboard-37139c96f04f781b053feefdbb5b3d28b2bcfc11.tar.gz
tapasboard-37139c96f04f781b053feefdbb5b3d28b2bcfc11.zip
fix timezones on real device
Diffstat (limited to 'forummodel.cpp')
-rw-r--r--forummodel.cpp6
1 files changed, 3 insertions, 3 deletions
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<Topic> &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));