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).

BUG: 300504
FIXED-IN: 4.8.4
This commit is contained in:
Frank Reininghaus 2012-05-26 16:29:51 +02:00
parent 98f63a671d
commit 288473a96c

View file

@ -546,7 +546,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();
}
}