- 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;
+ if (!searchPanel) {
+ return;
+ }
+
+ if (enabled) {
+ SearchPanel::SearchLocation searchLocation = SearchPanel::Everywhere;
+ const KUrl url = m_activeViewContainer->url();
+ const bool isSearchUrl = (url.protocol() == QLatin1String("nepomuksearch"));
+ if ((SearchSettings::location() == QLatin1String("FromHere") && !isSearchUrl)) {
+ searchLocation = SearchPanel::FromCurrentDir;