┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-10-07 22:05:55 +0000
committerPeter Penz <[email protected]>2008-10-07 22:05:55 +0000
commitc617050efb38c08f63a81cc49877996a5004808f (patch)
treeec2728c1df15c55f9b46769572d3f2c0f14bff62
parent0ee9ee0ea801c3d427b263153cfb20db041ec727 (diff)
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
-rw-r--r--src/dolphinmainwindow.cpp3
-rw-r--r--src/dolphinviewcontainer.cpp8
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 <kio/netaccess.h>
#include <kinputdialog.h>
#include <klocale.h>
+#include <kprotocolmanager.h>
#include <kmenu.h>
#include <kmenubar.h>
#include <kmessagebox.h>
@@ -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"));
}
}