X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/203449110e1763cbaee332a9b15d171c333e2df4..ca0a2c0cb286ef36dfd44ea9ed0816f862c523b7:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 7c7d7d309..31c82d606 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -110,6 +110,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) : connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(delayedStatusBarUpdate())); connect(m_view, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotViewUrlAboutToBeChanged(KUrl))); connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString))); + connect(m_view, SIGNAL(urlIsFileError(KUrl)), this, SLOT(slotUrlIsFileError(KUrl))); connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotUrlNavigatorLocationAboutToBeChanged(KUrl))); @@ -316,6 +317,22 @@ bool DolphinViewContainer::isSearchModeEnabled() const return m_searchBox->isVisible(); } +QString DolphinViewContainer::placesText() const +{ + QString text; + + if (isSearchModeEnabled()) { + text = m_searchBox->searchPath().fileName() + QLatin1String(": ") + m_searchBox->text(); + } else { + text = url().fileName(); + if (text.isEmpty()) { + text = url().host(); + } + } + + return text; +} + void DolphinViewContainer::setUrl(const KUrl& newUrl) { if (newUrl != m_urlNavigator->locationUrl()) { @@ -407,6 +424,12 @@ void DolphinViewContainer::slotDirectoryLoadingCompleted() } } +void DolphinViewContainer::slotUrlIsFileError(const KUrl& url) +{ + const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url); + slotItemActivated(item); +} + void DolphinViewContainer::slotItemActivated(const KFileItem& item) { // It is possible to activate items on inactive views by @@ -516,7 +539,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url) } else if (KProtocolManager::isSourceProtocol(url)) { QString app = "konqueror"; if (url.protocol().startsWith(QLatin1String("http"))) { - showMessage(i18nc("@info:status", + showMessage(i18nc("@info:status", // krazy:exclude=qmethods "Dolphin does not support web pages, the web browser has been launched"), Information);