summaryrefslogtreecommitdiff
path: root/fetchtopicsaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fetchtopicsaction.cpp')
-rw-r--r--fetchtopicsaction.cpp15
1 files changed, 4 insertions, 11 deletions
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;
-}