mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
always execute xdg-open in QDesktopServices::openUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
36bf899d8f
commit
b504735626
1 changed files with 2 additions and 34 deletions
|
@ -34,13 +34,6 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
inline static bool qt_launch(const QUrl &url, const QString &client)
|
||||
{
|
||||
QString command = client + QLatin1Char(' ') + url.toEncoded();
|
||||
return QProcess::startDetached(command);
|
||||
}
|
||||
|
||||
class QOpenUrlHandlerRegistry : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -172,33 +165,8 @@ bool QDesktopServices::openUrl(const QUrl &url)
|
|||
if (!url.isValid())
|
||||
return false;
|
||||
|
||||
if (url.scheme() == QLatin1String("file") || url.scheme() == QLatin1String("mailto")) {
|
||||
if (qt_launch(url, QLatin1String("xdg-open")))
|
||||
return true;
|
||||
|
||||
if (qt_launch(url, QLatin1String("firefox")))
|
||||
return true;
|
||||
if (qt_launch(url, QLatin1String("chromium")))
|
||||
return true;
|
||||
if (qt_launch(url, QLatin1String("opera")))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (qt_launch(url, QLatin1String("xdg-open")))
|
||||
return true;
|
||||
if (qt_launch(url, QLatin1String(qgetenv("DEFAULT_BROWSER"))))
|
||||
return true;
|
||||
if (qt_launch(url, QLatin1String(qgetenv("BROWSER"))))
|
||||
return true;
|
||||
|
||||
if (qt_launch(url, QLatin1String("firefox")))
|
||||
return true;
|
||||
if (qt_launch(url, QLatin1String("chromium")))
|
||||
return true;
|
||||
if (qt_launch(url, QLatin1String("opera")))
|
||||
return true;
|
||||
return false;
|
||||
const QString command = QLatin1String("xdg-open ") + url.toEncoded();
|
||||
return QProcess::startDetached(command);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Add table
Reference in a new issue