]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Show all items in the directory when the name filter is cleared
authorFrank Reininghaus <frank78ac@googlemail.com>
Sat, 26 May 2012 14:29:51 +0000 (16:29 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sat, 26 May 2012 14:35:31 +0000 (16:35 +0200)
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)

src/kitemviews/kfileitemmodel.cpp

index 831493d80fe8142a6e8353f69ea935e7f749a557..320b60b94b3dd52b62a93ffc8c16480be70cfc97 100644 (file)
@@ -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();
             }
         }