From e1c74b05fdae664aa9211cba3afb7993b51ec23b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 28 Aug 2009 21:53:18 +0000 Subject: Restore filtering of items. The DolphinView just tells the controller about the filter, the views (1:1 iconView + detailView, 1:n columnView) connect to the filter-changed signal and apply it to their proxy model. svn path=/trunk/KDE/kdebase/apps/; revision=1016782 --- src/dolphiniconsview.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/dolphiniconsview.cpp') diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index c48497e82..81b5c18d9 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * + * Copyright (C) 2006-2009 by Peter Penz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -22,6 +22,7 @@ #include "dolphincategorydrawer.h" #include "dolphincontroller.h" #include "settings/dolphinsettings.h" +#include "dolphinsortfilterproxymodel.h" #include "dolphinviewautoscroller.h" #include "dolphin_iconsmodesettings.h" #include "dolphin_generalsettings.h" @@ -85,6 +86,8 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle controller, SLOT(emitItemEntered(const QModelIndex&))); connect(this, SIGNAL(viewportEntered()), controller, SLOT(emitViewportEntered())); + connect(controller, SIGNAL(nameFilterChanged(const QString&)), + this, SLOT(setNameFilter(const QString&))); connect(controller, SIGNAL(zoomLevelChanged(int)), this, SLOT(setZoomLevel(int))); @@ -391,6 +394,12 @@ void DolphinIconsView::slotAdditionalInfoChanged() updateGridSize(showPreview, view->additionalInfo().count()); } +void DolphinIconsView::setNameFilter(const QString& nameFilter) +{ + DolphinSortFilterProxyModel* proxyModel = static_cast(model()); + proxyModel->setFilterRegExp(nameFilter); +} + void DolphinIconsView::setZoomLevel(int level) { IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings(); -- cgit v1.3