diff options
| author | Peter Penz <[email protected]> | 2011-04-20 22:10:18 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-04-20 22:11:22 +0200 |
| commit | 371e718ec58fc4b5b611f05102f9e4d0f0544ac2 (patch) | |
| tree | 80109d4ac3e388420ae37c70da9b4be9fe72d5a7 /src/dolphinmainwindow.cpp | |
| parent | 27a8c55ec9207ae00da91596ba390e835a066782 (diff) | |
Fix enabled/disabled issue of Search Panel
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index ed6d0f196..f5ac94f40 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -831,9 +831,9 @@ void DolphinMainWindow::slotSearchLocationChanged() SearchPanel* searchPanel = qobject_cast<SearchPanel*>(searchDock->widget()); if (searchPanel) { - searchPanel->setSearchMode(SearchSettings::location() == QLatin1String("FromHere") - ? SearchPanel::FromCurrentDir - : SearchPanel::Everywhere); + searchPanel->setSearchLocation(SearchSettings::location() == QLatin1String("FromHere") + ? SearchPanel::FromCurrentDir + : SearchPanel::Everywhere); } } @@ -1346,17 +1346,20 @@ void DolphinMainWindow::slotSearchModeChanged(bool enabled) } 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 (!searchPanel) { + return; + } - 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 (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; } - searchPanel->setSearchMode(searchMode); + searchPanel->setSearchLocation(searchLocation); + } else { + searchPanel->setSearchLocation(SearchPanel::Everywhere); } #else Q_UNUSED(enabled); |
