]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix crash #2 when filtering items
authorPeter Penz <peter.penz19@gmail.com>
Sun, 4 Dec 2011 19:45:54 +0000 (20:45 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 4 Dec 2011 19:50:01 +0000 (20:50 +0100)
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

index 3782621e9a844297d2411c444b47dd6560cc1ed8..b8ea1ca77bfc758d7e93105af8481888cba8029a 100644 (file)
@@ -737,7 +737,9 @@ KFileItemList KFileItemModelRolesUpdater::sortedItems(const QSet<KFileItem>& 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);