summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateu Batle <mateu.batle@collabora.co.uk>2011-04-29 08:52:53 -0500
committerMateu Batle <mateu.batle@collabora.co.uk>2011-04-29 08:52:53 -0500
commit3d2892601f00476ce6d5c08a367dd3aa43979ee6 (patch)
tree850a267a2be8b15db2836614a7f260d8cfc170c4
parentd39c1b0dd67cdbb662414a5b9024932196a2ec23 (diff)
Added check for count > 0 in removeRows
-rw-r--r--TelepathyQt4Yell/Models/abstract-conversation-model.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/TelepathyQt4Yell/Models/abstract-conversation-model.cpp b/TelepathyQt4Yell/Models/abstract-conversation-model.cpp
index 7542ed9..d3dea7d 100644
--- a/TelepathyQt4Yell/Models/abstract-conversation-model.cpp
+++ b/TelepathyQt4Yell/Models/abstract-conversation-model.cpp
@@ -253,7 +253,7 @@ void AbstractConversationModel::insertItems(QList<const EventItem *> items, int
bool AbstractConversationModel::removeRows(int row, int count, const QModelIndex &parent)
{
- if (row >= 0 && (row + count) <= mPriv->mItems.count()) {
+ if (row >= 0 && count > 0 && (row + count) <= mPriv->mItems.count()) {
beginRemoveRows(parent, row, row + count - 1);
while (count-- >= 0) {
mPriv->mItems.removeAt(row);