┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-08-28 21:53:18 +0000
committerPeter Penz <[email protected]>2009-08-28 21:53:18 +0000
commite1c74b05fdae664aa9211cba3afb7993b51ec23b (patch)
tree3f8a7a4dc75f2e27f8bbb85ec058fd1e59b1888f /src/dolphiniconsview.cpp
parent8d31eca0e0ee89c74318af0bc8a79c2d17e63187 (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/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp11
1 files changed, 10 insertions, 1 deletions
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 ([email protected]) *
+ * Copyright (C) 2006-2009 by Peter Penz <[email protected]> *
* *
* 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<DolphinSortFilterProxyModel*>(model());
+ proxyModel->setFilterRegExp(nameFilter);
+}
+
void DolphinIconsView::setZoomLevel(int level)
{
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();