diff options
| author | Peter Penz <[email protected]> | 2009-08-28 21:53:18 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-08-28 21:53:18 +0000 |
| commit | e1c74b05fdae664aa9211cba3afb7993b51ec23b (patch) | |
| tree | 3f8a7a4dc75f2e27f8bbb85ec058fd1e59b1888f /src/dolphindetailsview.cpp | |
| parent | 8d31eca0e0ee89c74318af0bc8a79c2d17e63187 (diff) | |
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
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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 <klocale.h> #include <kmenu.h> -#include <QAbstractProxyModel> #include <QAction> #include <QApplication> #include <QHeaderView> @@ -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<DolphinSortFilterProxyModel*>(model()); + proxyModel->setFilterRegExp(nameFilter); +} + void DolphinDetailsView::setZoomLevel(int level) { const int size = ZoomLevelInfo::iconSizeForZoomLevel(level); |
