diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-04-04 16:46:18 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-04-04 16:46:18 +0200 |
commit | 256e7837ce8cb30b0c0a8c73306abdffa80365a6 (patch) | |
tree | 0246f39a00acb45ec3b3e0c7e99380837f609ab6 /fetchpostsaction.cpp | |
parent | 6c51fc938bdc764c0426eba6bed2d3a9c37563af (diff) | |
download | tapasboard-256e7837ce8cb30b0c0a8c73306abdffa80365a6.tar.gz tapasboard-256e7837ce8cb30b0c0a8c73306abdffa80365a6.zip |
fix a few issues
Diffstat (limited to 'fetchpostsaction.cpp')
-rw-r--r-- | fetchpostsaction.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
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; |