┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-12-04 18:16:39 +0100
committerPeter Penz <[email protected]>2011-12-04 18:21:46 +0100
commit854b0acd1a259fab40e42c8470bb144c955dcc5a (patch)
tree376e1aa31a85dd410ba1d4236cb0b3c26c83763a /src/kitemviews/kfileitemmodel.h
parent031b1a4c19945456a389ddb00630aadf95b0c09a (diff)
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
Diffstat (limited to 'src/kitemviews/kfileitemmodel.h')
-rw-r--r--src/kitemviews/kfileitemmodel.h6
1 files changed, 3 insertions, 3 deletions
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<KDirLister> m_dirLister;
@@ -293,7 +293,7 @@ private:
QHash<KUrl, int> 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<KFileItem> m_filteredItems; // Items that got hidden by KFileItemModel::setNameFilter()
bool m_requestRole[RolesCount];