From 7263a091c5c11220a27332be7127589d51d1092d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 4 Dec 2011 20:45:54 +0100 Subject: Fix crash #2 when filtering items When KFileItems get removed from the model it is temporary possible that the pending items are still part of the KFileItemModelRolesUpdater while they have already been removed from the model (this happens in the context during the signal itemsRemoved() gets emitted). BUG: 287642 --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 3782621e9..b8ea1ca77 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -737,7 +737,9 @@ KFileItemList KFileItemModelRolesUpdater::sortedItems(const QSet& ite while (it.hasNext()) { const KFileItem item = it.next(); const int index = m_model->index(item); - indexes.append(index); + if (index >= 0) { + indexes.append(index); + } } qSort(indexes); -- cgit v1.3