From 984c20161bc71684325a1394cfbb292683c94d53 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 10 Mar 2011 23:17:55 +0100 Subject: Add search modes for the Search Panel The search panel must get a hint whether clicking on the facets should result in searching everywhere or from the current folder. It is not sufficient to check the search-settings of the "Find:"-box, as when the "Find:"-box is invisible there is no hint for the user what kind of searching is done and the setting must be ignored. --- src/dolphinmainwindow.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index f9c9bf0df..482a5b7e8 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -51,6 +51,7 @@ #include "dolphin_generalsettings.h" #include "dolphin_iconsmodesettings.h" +#include "dolphin_searchsettings.h" #include #include @@ -1247,6 +1248,20 @@ void DolphinMainWindow::slotSearchModeChanged(bool enabled) } m_searchDockIsTemporaryVisible = false; } + + SearchPanel* searchPanel = qobject_cast(searchDock->widget()); + if (searchPanel) { + // Per default any search-operation triggered by the Search Panel is done + // "Everywhere". + SearchPanel::SearchMode searchMode = SearchPanel::Everywhere; + + if (enabled && (SearchSettings::location() == QLatin1String("FromHere"))) { + // Only if the search-mode is enabled it is visible for the user whether + // a searching is done "Everywhere" or "From Here" (= current directory). + searchMode = SearchPanel::FromCurrentDir; + } + searchPanel->setSearchMode(searchMode); + } #else Q_UNUSED(enabled); #endif -- cgit v1.3