#include <kio/netaccess.h>
#include <kinputdialog.h>
#include <klocale.h>
+#include <kprotocolmanager.h>
#include <kmenu.h>
#include <kmenubar.h>
#include <kmessagebox.h>
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().
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"));
}
}