mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
cleanup X11 desktop service implementation
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
9f7847d81f
commit
2aad877609
1 changed files with 4 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue