]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindetailsview.cpp
Restore filtering of items. The DolphinView just tells the controller about the filte...
[dolphin.git] / src / dolphindetailsview.cpp
index 69fe5760f0ea5e376d44666b80bc6b5585b4d3a7..92ffd5e1f44bf02b501d85bdb0693444193eed13 100644 (file)
@@ -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);
@@ -546,7 +553,6 @@ void DolphinDetailsView::setZoomLevel(int level)
     updateDecorationSize(showPreview);
 }
 
-
 void DolphinDetailsView::slotShowPreviewChanged()
 {
     const DolphinView* view = m_controller->dolphinView();