From: Ivailo Monev Date: Wed, 10 Aug 2016 14:58:41 +0000 (+0000) Subject: cleanup X11 desktop service implementation X-Git-Tag: 4.12.0~6856 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2aad877609273220c5b901b20fe792c267ffefec;p=kde%2FKatie.git cleanup X11 desktop service implementation Signed-off-by: Ivailo Monev --- diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp index aa1b06d73..7e9eddf47 100644 --- a/src/gui/util/qdesktopservices_x11.cpp +++ b/src/gui/util/qdesktopservices_x11.cpp @@ -71,20 +71,9 @@ static bool openDocument(const QUrl &url) if (launch(url, QLatin1String("xdg-open"))) return true; - // Use the X11->desktopEnvironment value if X11 is non-NULL, - // otherwise just attempt to launch command regardless of the desktop environment - if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) { - return true; - } else { - if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient exec"))) - return true; - } - if (launch(url, QLatin1String("firefox"))) return true; - if (launch(url, QLatin1String("mozilla"))) - return true; - if (launch(url, QLatin1String("netscape"))) + if (launch(url, QLatin1String("chromium"))) return true; if (launch(url, QLatin1String("opera"))) return true; @@ -101,24 +90,14 @@ static bool launchWebBrowser(const QUrl &url) if (launch(url, QLatin1String("xdg-open"))) return true; - if (launch(url, QString::fromLocal8Bit(getenv("DEFAULT_BROWSER")))) + if (launch(url, QString::fromLocal8Bit(qgetenv("DEFAULT_BROWSER")))) return true; - if (launch(url, QString::fromLocal8Bit(getenv("BROWSER")))) + if (launch(url, QString::fromLocal8Bit(qgetenv("BROWSER")))) return true; - // Use the X11->desktopEnvironment value if X11 is non-NULL, - // otherwise just attempt to launch command regardless of the desktop environment - if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) { - return true; - } else if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient openURL"))) { - return true; - } - if (launch(url, QLatin1String("firefox"))) return true; - if (launch(url, QLatin1String("mozilla"))) - return true; - if (launch(url, QLatin1String("netscape"))) + if (launch(url, QLatin1String("chromium"))) return true; if (launch(url, QLatin1String("opera"))) return true;