/***************************************************************************
- * Copyright (C) 2007 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2007 by Peter Penz <peter.penz19@gmail.com> *
* *
* 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 *
#include <KIO/NetAccess>
#include <KIO/PreviewJob>
#include <KMenu>
-#include <knewmenu.h>
+#include <KNewFileMenu>
#include <konqmimedata.h>
#include <konq_operations.h>
#include <KShell>
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)) {
void DolphinViewContainer::setFilterBarVisible(bool visible)
{
- Q_ASSERT(m_filterBar != 0);
+ Q_ASSERT(m_filterBar);
if (visible) {
m_filterBar->show();
m_filterBar->setFocus();
{
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);
}
}
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);
void DolphinViewContainer::stopLoading()
{
m_view->stopLoading();
+ m_statusBar->setProgress(100);
}
bool DolphinViewContainer::isSearchUrl(const KUrl& url) const