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/dolphindetailsview.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/dolphindetailsview.cpp') diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 7f75fdda6..92ffd5e1f 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -122,6 +121,8 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr this, SLOT(slotEntered(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))); connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()), @@ -531,6 +532,12 @@ QRect DolphinDetailsView::elasticBandRect() const return QRect(topLeft, bottomRight).normalized(); } +void DolphinDetailsView::setNameFilter(const QString& nameFilter) +{ + DolphinSortFilterProxyModel* proxyModel = static_cast(model()); + proxyModel->setFilterRegExp(nameFilter); +} + void DolphinDetailsView::setZoomLevel(int level) { const int size = ZoomLevelInfo::iconSizeForZoomLevel(level); -- cgit v1.3