From b04a2a981a91ed58e55a275402cb2f9f73bd85a2 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 6 Apr 2013 17:42:47 +0200 Subject: timezone issue was tapatalk plugin bug, so remove workaround --- fetchtopicsaction.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'fetchtopicsaction.cpp') diff --git a/fetchtopicsaction.cpp b/fetchtopicsaction.cpp index d71bdca..9e42723 100644 --- a/fetchtopicsaction.cpp +++ b/fetchtopicsaction.cpp @@ -85,13 +85,13 @@ void FetchTopicsAction::handleFinishedCall() query.bindValue(":forum_id", forum_id); query.bindValue(":topic_id", topic_id); - query.bindValue(":topic_title", unencodeTopicText(topic["topic_title"])); + query.bindValue(":topic_title", decodeTopicText(topic["topic_title"])); query.bindValue(":topic_author_id", topic["topic_author_id"].toInt()); - query.bindValue(":topic_author_name", unencodeTopicText(topic["topic_author_name"])); + query.bindValue(":topic_author_name", decodeTopicText(topic["topic_author_name"])); 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", unencodeDateTime(topic["last_reply_time"])); + query.bindValue(":last_reply_time", topic["last_reply_time"].toDateTime().toUTC()); query.bindValue(":reply_number", topic["reply_number"].toInt()); query.bindValue(":new_post", topic["new_post"].toBool() ? 1 : 0); query.bindValue(":position", position); @@ -130,15 +130,8 @@ void FetchTopicsAction::handleFinishedCall() _call->deleteLater(); } -QString FetchTopicsAction::unencodeTopicText(const QVariant &v) +QString FetchTopicsAction::decodeTopicText(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; -} -- cgit v1.2.3