diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 7 | ||||
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 718615222..48278312f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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); diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 99ff253c2..89ed54aca 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -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) |
