]> cloud.milkyroute.net Git - dolphin.git/commitdiff
improvement to previous commit: check whether the URL can be listed by asking the...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 7 Oct 2008 22:05:55 +0000 (22:05 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 7 Oct 2008 22:05:55 +0000 (22:05 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=869022

src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp

index 48278312fcaf52527dde6d2190bf4fba4a0dd0ee..20d130ed3d08c652f9612b6ed9617aeb27d8eb14 100644 (file)
@@ -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().
index 89ed54aca167005c23abd87ea2604384c3135d90..bed7d275848eee531f92b4813f5fe3be0bc3cb67 100644 (file)
@@ -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"));        
     }
 }