diff options
| author | Peter Penz <[email protected]> | 2011-12-04 20:45:54 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-04 20:50:01 +0100 |
| commit | 7263a091c5c11220a27332be7127589d51d1092d (patch) | |
| tree | 8ceb1388713e442b5068fbf6d56dcc3046e06b5a /src | |
| parent | 854b0acd1a259fab40e42c8470bb144c955dcc5a (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kfileitemmodelrolesupdater.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<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); |
