]> cloud.milkyroute.net Git - dolphin.git/commitdiff
If an URL cannot be listed, just let the view and the panels show the last listable...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 7 Oct 2008 20:29:18 +0000 (20:29 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 7 Oct 2008 20:29:18 +0000 (20:29 +0000)
BUG: 170695

svn path=/trunk/KDE/kdebase/apps/; revision=868984

src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp

index 7186152226b9f5e009869eef13efbb94d4cf996b..48278312fcaf52527dde6d2190bf4fba4a0dd0ee 100644 (file)
@@ -200,6 +200,13 @@ void DolphinMainWindow::pasteIntoFolder()
 
 void DolphinMainWindow::changeUrl(const KUrl& url)
 {
+    if (url.protocol().isEmpty()) {
+        // The URL navigator only checks for validity, not
+        // if the URL can be listed. An error message is
+        // shown due to DolphinViewContainer::restoreView().
+        return;
+    }
+    
     DolphinViewContainer* view = activeViewContainer();
     if (view != 0) {
         view->setUrl(url);
index 99ff253c2035b560aed27f7548896a8fa4101159..89ed54aca167005c23abd87ea2604384c3135d90 100644 (file)
@@ -350,7 +350,13 @@ void DolphinViewContainer::activate()
 
 void DolphinViewContainer::restoreView(const KUrl& url)
 {
-    m_view->updateView(url, m_urlNavigator->savedRootUrl());
+    if (url.protocol().isEmpty()) {
+        // 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());
+    }
 }
 
 void DolphinViewContainer::saveRootUrl(const KUrl& url)