From: Peter Penz Date: Sun, 4 Dec 2011 19:45:54 +0000 (+0100) Subject: Fix crash #2 when filtering items X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/7263a091c5c11220a27332be7127589d51d1092d?ds=inline 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 --- 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);