diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-04-07 00:37:27 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-04-07 00:37:27 +0200 |
commit | 81cfd7c483940c0672f35f91e088de9d7760fec1 (patch) | |
tree | 99426bafb7ee4ca9a58fb5b4fe21a3ed206e6c83 | |
parent | 3601ee3e4af4f0977b8e8a58d122f2c0c95d5b5c (diff) | |
download | tapasboard-81cfd7c483940c0672f35f91e088de9d7760fec1.tar.gz tapasboard-81cfd7c483940c0672f35f91e088de9d7760fec1.zip |
allow the topic model to actually delete topics
-rw-r--r-- | forummodel.cpp | 7 |
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()) { |