From 854b0acd1a259fab40e42c8470bb144c955dcc5a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 4 Dec 2011 18:16:39 +0100 Subject: Fix crash #1 when filtering items When filtering items it was possible that the current index got an invalid value which resulted in accessing the URL of a null-KFileItem. There is still one (general) open issue in KFileItemModelRolesUpdater (crash #2) where a KFileItem that is already null gets read. It is not really related to filtering but can be triggered quite easy when filtering huge directories with enabled previews. CCBUG: 287642 --- src/kitemviews/kfileitemmodel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kitemviews/kfileitemmodel.h') diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index a83d57ba8..5d0aa4203 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -275,9 +275,9 @@ private: bool isChildItem(int index) const; /** - * @return True if the given item matches with the name filter. + * @return True if the given item matches with the current set name filter. */ - static bool matchesNameFilter(const KFileItem& item, const QString& nameFilter); + bool matchesNameFilter(const KFileItem& item) const; private: QWeakPointer m_dirLister; @@ -293,7 +293,7 @@ private: QHash m_items; // Allows O(1) access for KFileItemModel::index(const KFileItem& item) QString m_nameFilter; - KFileItemList m_filteredItems; // Items that got hidden by KFileItemModel::setNameFilter() + QSet m_filteredItems; // Items that got hidden by KFileItemModel::setNameFilter() bool m_requestRole[RolesCount]; -- cgit v1.3.1