┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-11-13 18:15:12 +0000
committerPeter Penz <[email protected]>2008-11-13 18:15:12 +0000
commitb0e2579178223063cf5028fc4a6dd30888801ef3 (patch)
tree4e99ce7303eeb76476da1bca96563f9f1f0aa944 /src
parentc0fd7f2a19d82e91df1ec795aee7b335b442f0e8 (diff)
* don't launch Konqueror when the protocol is invalid
* launch default browser when the protocol is http CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=883858
Diffstat (limited to 'src')
-rw-r--r--src/dolphinviewcontainer.cpp22
1 files changed, 17 insertions, 5 deletions
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"));
}
}