X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/956ebf71156ddca0301adc8a9ff87880cfa5dac9..747a86573feb65e2ffe57cdae7dedf6ad272e789:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 77a2f3f36..540f38954 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007 by Peter Penz * + * Copyright (C) 2007 by Peter Penz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -212,11 +212,13 @@ 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)); + // 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. - KUrl url = m_urlNavigator->locationUrl(); - int index = m_urlNavigator->historyIndex(); const int historySize = m_urlNavigator->historySize(); while (isSearchUrl(url) && (index < historySize)) { @@ -257,7 +259,7 @@ void DolphinViewContainer::setUrl(const KUrl& newUrl) void DolphinViewContainer::setFilterBarVisible(bool visible) { - Q_ASSERT(m_filterBar != 0); + Q_ASSERT(m_filterBar); if (visible) { m_filterBar->show(); m_filterBar->setFocus(); @@ -336,7 +338,7 @@ void DolphinViewContainer::slotFinishedPathLoading() m_statusBar->setProgress(100); } - if (isSearchUrl(url()) && (m_view->items().count() == 0)) { + if (isSearchUrl(url()) && m_view->items().isEmpty()) { // The dir lister has been completed on a Nepomuk-URI and no items have been found. Instead // of showing the default status bar information ("0 items") a more helpful information is given: m_statusBar->setMessage(i18nc("@info:status", "No items found."), DolphinStatusBar::Information); @@ -501,6 +503,7 @@ void DolphinViewContainer::closeSearchBox() void DolphinViewContainer::stopLoading() { m_view->stopLoading(); + m_statusBar->setProgress(100); } bool DolphinViewContainer::isSearchUrl(const KUrl& url) const