From 256e7837ce8cb30b0c0a8c73306abdffa80365a6 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Thu, 4 Apr 2013 16:46:18 +0200 Subject: fix a few issues --- fetchpostsaction.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'fetchpostsaction.cpp') diff --git a/fetchpostsaction.cpp b/fetchpostsaction.cpp index 714718c..e38e423 100644 --- a/fetchpostsaction.cpp +++ b/fetchpostsaction.cpp @@ -65,9 +65,7 @@ void FetchPostsAction::handleFinishedCall() // Not fatal, just assume it's the one we requested topic_id = _topicId; } - QString topic_title = map["topic_title"].toString(); - int unread_position = map["position"].toInt(); - qDebug() << "unread_position" << unread_position; + QString topic_title = unencodePostContent(map["topic_title"]); QSqlQuery query(db); query.prepare("INSERT OR REPLACE INTO posts (topic_id, post_id, post_title, post_content, post_author_id, post_author_name, can_edit, icon_url, post_time, last_update_time) " @@ -105,10 +103,6 @@ void FetchPostsAction::handleFinishedCall() _board->notifyTopicPostsChanged(_topicId, _start, _start + posts.size() - 1); } - if (unread_position > 0) { - // API says this is 1-indexed instead of 0-indexed. - _board->notifyTopicPostsUnread(_topicId, unread_position - 1); - } if (_end == FetchAllPosts && posts.size() == MAX_TOPIC_PAGE_SIZE) { // Ok, let's prepare to fetch the next block of posts because // there are probably more of them @@ -132,7 +126,8 @@ QString FetchPostsAction::unencodePostText(const QVariant &v) QString FetchPostsAction::unencodePostTitle(const QVariant &v, const QString &topicTitle) { QString title = unencodePostText(v); - if (QString::compare(title, "Re: " + topicTitle, Qt::CaseInsensitive)) { + if (QString::compare(title, "Re: " + topicTitle, Qt::CaseInsensitive) == 0) { + // Hack to disable the useless "Re: $TOPIC_TITLE" post titles everywhere return QString(); } return title; -- cgit v1.2.3