From: Peter Penz Date: Thu, 13 Nov 2008 18:15:12 +0000 (+0000) Subject: * don't launch Konqueror when the protocol is invalid X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b0e2579178223063cf5028fc4a6dd30888801ef3 * don't launch Konqueror when the protocol is invalid * launch default browser when the protocol is http CCMAIL: faure@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=883858 --- diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 6795aca9b..6e5385f5e 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -355,12 +355,24 @@ void DolphinViewContainer::restoreView(const KUrl& url) { if (KProtocolManager::supportsListing(url)) { m_view->updateView(url, m_urlNavigator->savedRootUrl()); + } else if (KProtocolManager::isSourceProtocol(url)) { + QString app = "konqueror"; + if (url.protocol().startsWith(QLatin1String("http"))) { + showErrorMessage(i18nc("@info:status", + "Dolphin does not support web pages, the web browser has been launched")); + const KConfigGroup config(KSharedConfig::openConfig("kdeglobals"), "General"); + const QString browser = config.readEntry("BrowserApplication"); + if (!browser.isEmpty()) { + app = browser; + } + } else { + showErrorMessage(i18nc("@info:status", + "Protocol not supported by Dolphin, Konqueror has been launched")); + } + const QString command = app + ' ' + url.pathOrUrl(); + KRun::runCommand(command, app, app, this); } else { - // The URL navigator only checks for validity, not - // if the URL can be listed. - showErrorMessage(i18nc("@info:status", "Protocol not supported by Dolphin, Konqueror has been launched")); - QString command = "konqueror " + url.pathOrUrl(); - KRun::runCommand(command, "konqueror", "konqueror", this); + showErrorMessage(i18nc("@info:status", "Invalid protocol")); } }