X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/956ebf71156ddca0301adc8a9ff87880cfa5dac9..c7ef72de5563ae33e9342526cb33d67498de0759:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 77a2f3f36..6deb7b846 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(); @@ -286,21 +288,12 @@ void DolphinViewContainer::updateStatusBar() { m_statusBarTimestamp.start(); - // As the item count information is less important - // in comparison with other messages, it should only - // be shown if: - // - the status bar is empty or - // - shows already the item count information or - // - shows only a not very important information const QString newMessage = m_view->statusBarText(); - const QString currentMessage = m_statusBar->message(); - const bool updateStatusBarMsg = currentMessage.isEmpty() - || (currentMessage == m_statusBar->defaultText()) - || (m_statusBar->type() == DolphinStatusBar::Information); - m_statusBar->setDefaultText(newMessage); - if (updateStatusBarMsg) { + // We don't want to override errors. Other messages are only protected by + // the Statusbar itself depending on timings (see DolphinStatusBar::setMessage). + if (m_statusBar->type() != DolphinStatusBar::Error) { m_statusBar->setMessage(newMessage, DolphinStatusBar::Default); } } @@ -336,7 +329,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 +494,7 @@ void DolphinViewContainer::closeSearchBox() void DolphinViewContainer::stopLoading() { m_view->stopLoading(); + m_statusBar->setProgress(100); } bool DolphinViewContainer::isSearchUrl(const KUrl& url) const