summaryrefslogtreecommitdiff
path: root/fetchtopicsaction.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 /fetchtopicsaction.cpp
parent3f3a98b7e49230aabd0e557ea59e89e20537ca8a (diff)
downloadtapasboard-37139c96f04f781b053feefdbb5b3d28b2bcfc11.tar.gz
tapasboard-37139c96f04f781b053feefdbb5b3d28b2bcfc11.zip
fix timezones on real device
Diffstat (limited to 'fetchtopicsaction.cpp')
-rw-r--r--fetchtopicsaction.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/fetchtopicsaction.cpp b/fetchtopicsaction.cpp
index 13aebdd..d71bdca 100644
--- a/fetchtopicsaction.cpp
+++ b/fetchtopicsaction.cpp
@@ -91,11 +91,11 @@ void FetchTopicsAction::handleFinishedCall()
query.bindValue(":is_subscribed", topic["is_subscribed"].toBool() ? 1 : 0);
query.bindValue(":is_closed", topic["is_closed"].toBool() ? 1 : 0);
query.bindValue(":icon_url", topic["icon_url"].toString());
- query.bindValue(":last_reply_time", topic["last_reply_time"].toDateTime());
+ query.bindValue(":last_reply_time", unencodeDateTime(topic["last_reply_time"]));
query.bindValue(":reply_number", topic["reply_number"].toInt());
query.bindValue(":new_post", topic["new_post"].toBool() ? 1 : 0);
query.bindValue(":position", position);
- query.bindValue(":last_update_time", QDateTime::currentDateTime());
+ query.bindValue(":last_update_time", QDateTime::currentDateTimeUtc());
position++;
@@ -135,3 +135,10 @@ QString FetchTopicsAction::unencodeTopicText(const QVariant &v)
QByteArray ba = v.toByteArray();
return QString::fromUtf8(ba.constData(), ba.length());
}
+
+QDateTime FetchTopicsAction::unencodeDateTime(const QVariant &v)
+{
+ QDateTime dt = v.toDateTime();
+ dt.setTimeSpec(Qt::UTC);
+ return dt;
+}