summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-04-07 00:37:27 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-04-07 00:37:27 +0200
commit81cfd7c483940c0672f35f91e088de9d7760fec1 (patch)
tree99426bafb7ee4ca9a58fb5b4fe21a3ed206e6c83
parent3601ee3e4af4f0977b8e8a58d122f2c0c95d5b5c (diff)
downloadtapasboard-81cfd7c483940c0672f35f91e088de9d7760fec1.tar.gz
tapasboard-81cfd7c483940c0672f35f91e088de9d7760fec1.zip
allow the topic model to actually delete topics
-rw-r--r--forummodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/forummodel.cpp b/forummodel.cpp
index 3167769..7408f32 100644
--- a/forummodel.cpp
+++ b/forummodel.cpp
@@ -248,6 +248,13 @@ void ForumModel::handleForumTopicsChanged(int forumId, int start, int end)
if (topics.size() < end - start + 1) {
_eof = true; // Short read
end = start + topics.size() - 1;
+ if (_data.size() > end + 1) {
+ beginRemoveRows(QModelIndex(), end + 1, _data.size());
+ while (_data.size() > end + 1) {
+ _data.removeLast();
+ }
+ endRemoveRows();
+ }
}
if (end >= _data.size()) {