┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-03-10 23:17:55 +0100
committerPeter Penz <[email protected]>2011-03-10 23:21:42 +0100
commit984c20161bc71684325a1394cfbb292683c94d53 (patch)
tree8be45dd133b78acb2acbfa65a9d1bb49d8cf60be /src/dolphinmainwindow.cpp
parent6e0583f9888fcf46bb89735423b02b5ca53f1459 (diff)
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.
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp15
1 files changed, 15 insertions, 0 deletions
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 <KAction>
#include <KActionCollection>
@@ -1247,6 +1248,20 @@ void DolphinMainWindow::slotSearchModeChanged(bool enabled)
}
m_searchDockIsTemporaryVisible = false;
}
+
+ SearchPanel* searchPanel = qobject_cast<SearchPanel*>(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