┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-05-26 16:29:51 +0200
committerFrank Reininghaus <[email protected]>2012-05-26 16:35:31 +0200
commit23ab6051577189897da9072d172ba35e911e62a4 (patch)
treeeb83891b9710f94cba845eb7efe0b77f8a3d00eb /src
parentf061d2a6b3421d9b087c99161323d0df3a3b443e (diff)
Show all items in the directory when the name filter is cleared
The problem was the following: While a QMutableSetIterator iterates the items in the QSet m_filteredItems, all items that match the new filter are removed from the set. However, to ensure that the iterator still reaches all items in the set, one must not use QSet::remove(), but rather the iterator's remove() method (see QMutableSetIterator docs). CCBUG: 300504 (cherry picked from commit 288473a96cdd8888f7fc91d0a551d6cbde5fd5dc)
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 831493d80..320b60b94 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -530,7 +530,7 @@ void KFileItemModel::setNameFilter(const QString& nameFilter)
const KFileItem item = it.next();
if (m_filter.matches(item)) {
newVisibleItems.append(item);
- m_filteredItems.remove(item);
+ it.remove();
}
}