From c617050efb38c08f63a81cc49877996a5004808f Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 7 Oct 2008 22:05:55 +0000 Subject: [PATCH] improvement to previous commit: check whether the URL can be listed by asking the protocol manager (thanks to David Faure for the hint) svn path=/trunk/KDE/kdebase/apps/; revision=869022 --- src/dolphinmainwindow.cpp | 3 ++- src/dolphinviewcontainer.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 48278312f..20d130ed3 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -200,7 +201,7 @@ void DolphinMainWindow::pasteIntoFolder() void DolphinMainWindow::changeUrl(const KUrl& url) { - if (url.protocol().isEmpty()) { + if (!KProtocolManager::supportsListing(url)) { // The URL navigator only checks for validity, not // if the URL can be listed. An error message is // shown due to DolphinViewContainer::restoreView(). diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 89ed54aca..bed7d2758 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -350,12 +350,12 @@ void DolphinViewContainer::activate() void DolphinViewContainer::restoreView(const KUrl& url) { - if (url.protocol().isEmpty()) { + if (KProtocolManager::supportsListing(url)) { + m_view->updateView(url, m_urlNavigator->savedRootUrl()); + } else { // The URL navigator only checks for validity, not // if the URL can be listed. - showErrorMessage(i18nc("@info:status", "Protocol not supported")); - } else { - m_view->updateView(url, m_urlNavigator->savedRootUrl()); + showErrorMessage(i18nc("@info:status", "Protocol not supported")); } } -- 2.47.3