From 81cfd7c483940c0672f35f91e088de9d7760fec1 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 7 Apr 2013 00:37:27 +0200 Subject: allow the topic model to actually delete topics --- forummodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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()) { -- cgit v1.2.3