diff options
| author | Frank Reininghaus <[email protected]> | 2014-05-13 18:42:05 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2014-05-13 18:42:05 +0200 |
| commit | 4cf04b91dd8804f2536fc31ae2f1b486bfc8cf9c (patch) | |
| tree | 75aee505fe55fabedf33fa202cc4b4e4f6481a71 /src/dolphinviewcontainer.cpp | |
| parent | 7e92abb4ea2c2b269d21973bc9f2e76da5fb9114 (diff) | |
| parent | 5780fab172e02c3dd44082aa10d37cd87a98e29b (diff) | |
Merge remote-tracking branch 'origin/master' into frameworks
Since the master branch had never been merged into frameworks since the
creation of the frameworks branch, I had to fix a couple of merge
conflicts and make another change in order to make it build - I hope I
did not get anything wrong.
We should probably merge master into frameworks on a regular basis from
now on.
CCMAIL:[email protected]
Conflicts:
dolphin/src/dolphinmainwindow.cpp
dolphin/src/search/dolphinfacetswidget.cpp
dolphin/src/statusbar/dolphinstatusbar.cpp
dolphin/src/views/dolphinview.cpp
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index ae9cd93c0..761062585 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -338,36 +338,18 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled) m_urlNavigator->setVisible(!enabled); if (enabled) { - KUrl url = m_urlNavigator->locationUrl(); - m_searchBox->setText(QString()); - m_searchBox->setReadOnly(isSearchUrl(url), url); - - // Remember the most recent non-search URL as search path - // of the search-box, so that it can be restored - // when switching back to the URL navigator. - int index = m_urlNavigator->historyIndex(); - const int historySize = m_urlNavigator->historySize(); - while (isSearchUrl(url) && (index < historySize)) { - ++index; - url = m_urlNavigator->locationUrl(index); - } - - if (!isSearchUrl(url)) { - m_searchBox->setSearchPath(url); - } + const KUrl& locationUrl = m_urlNavigator->locationUrl(); + m_searchBox->fromSearchUrl(locationUrl); } else { m_view->setViewPropertiesContext(QString()); // Restore the URL for the URL navigator. If Dolphin has been // started with a search-URL, the home URL is used as fallback. - const KUrl url = m_searchBox->searchPath(); - if (url.isValid() && !url.isEmpty()) { - if (isSearchUrl(url)) { - m_urlNavigator->goHome(); - } else { - m_urlNavigator->setLocationUrl(url); - } + KUrl url = m_searchBox->searchPath(); + if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) { + url = GeneralSettings::self()->homeUrl(); } + m_urlNavigator->setLocationUrl(url); } } |
