[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkdelibs/KDE/4=2E7=5D_kdecore/kernel=3A_Fixed_non-we?=
From: Dawit Alemayehu <adawit () kde ! org>
Date: 2011-06-30 19:35:40
Message-ID: 20110630193540.43BE4A60A9 () git ! kde ! org
[Download RAW message or body]
Git commit 7004ce8496b5c85bac644ef3951a3da8c50be8e1 by Dawit Alemayehu.
Committed on 27/06/2011 at 19:09.
Pushed by adawit into branch 'KDE/4.7'.
Fixed non-web page urls, e.g. images, being opened as html pages when loaded
from external applications.
BUG: 264562
FIXED-IN: 4.7.0
REVIEW: 101778
M +11 -1 kdecore/kernel/ktoolinvocation_x11.cpp
http://commits.kde.org/kdelibs/7004ce8496b5c85bac644ef3951a3da8c50be8e1
diff --git a/kdecore/kernel/ktoolinvocation_x11.cpp \
b/kdecore/kernel/ktoolinvocation_x11.cpp index c86a77b..5168f2f 100644
--- a/kdecore/kernel/ktoolinvocation_x11.cpp
+++ b/kdecore/kernel/ktoolinvocation_x11.cpp
@@ -340,9 +340,19 @@ void KToolInvocation::invokeBrowser( const QString &url, const \
QByteArray& start } else {
const KService::Ptr htmlApp = \
KMimeTypeTrader::self()->preferredService(QLatin1String("text/html")); if (htmlApp) \
{ + // WORKAROUND: For bugs 264562 and 265474:
+ // In order to correctly handle non-HTML urls we change the service
+ // desktop file name to "kfmclient.desktop" whenever the above query
+ // returns "kfmclient_html.desktop".Otherwise, the hard coded \
mime-type + // "text/html" mime-type parameter in the kfmclient_html \
will cause all + // URLs to be treated as if they are HTML page.
+ QString entryPath = htmlApp->entryPath();
+ if (entryPath.endsWith(QLatin1String("kfmclient_html.desktop"))) {
+ entryPath.remove(entryPath.length()-13, 5);
+ }
QString error;
int pid = 0;
- int err = startServiceByDesktopPath(htmlApp->entryPath(), url, \
&error, 0, &pid, startup_id); + int err = \
startServiceByDesktopPath(entryPath, url, &error, 0, &pid, startup_id); if (err != \
0) { KMessage::message(KMessage::Error,
// TODO: i18n("Could not launch %1:\n\n%2", \
htmlApp->exec(), error),
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic