summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()) {