From f7e58e096623f8c23637389258d0bdb5f977bf89 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sun, 24 Dec 2006 00:03:40 +0000 Subject: -Use QSortFilterProxyModel for filtering instead of KDirList::setFilterName -Map DolphinView::Sorting to a column of the KDirModel and sort this column -Reimplement QAbstractItemModel::sort(int,SortOrder) to keep track of the sorted column and order as dolphin uses this in the config dialogs. We will now work correctly if a view changes sorting. svn path=/trunk/playground/utils/dolphin/; revision=616170 --- src/dolphinview.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 1efe33384..8fb16d1d5 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -968,8 +968,20 @@ void DolphinView::slotChangeNameFilter(const QString& nameFilter) adjustedFilter.insert(0, '*'); adjustedFilter.append('*'); +/* + * Use the ProxyModel to filter: + * This code is #ifdefed as setNameFilter behaves + * slightly different than the QSortFilterProxyModel + * as it will not remove directories. I will ask + * our beloved usability experts for input + * -- z. + */ +#if 0 m_dirLister->setNameFilter(adjustedFilter); m_dirLister->emitChanges(); +#else + m_proxyModel->setFilterRegExp( nameFilter ); +#endif } void DolphinView::applyModeToView() -- cgit v1.3