diff options
author | Dan Elkouby | 2020-10-31 18:12:38 +0200 |
---|---|---|
committer | Dan Elkouby | 2020-10-31 18:33:42 +0200 |
commit | 89f1642161786b2724e2e1d3ec0969f756a3bef8 (patch) | |
tree | c2918019ab56cefd3f5acfd7783e7a24dc197306 /use_xdg-open.patch | |
parent | 067d7c3d006581f5a544151f8cb2a5276da9a17a (diff) | |
download | aur-89f1642161786b2724e2e1d3ec0969f756a3bef8.tar.gz |
Add xdg-open patch
Diffstat (limited to 'use_xdg-open.patch')
-rw-r--r-- | use_xdg-open.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/use_xdg-open.patch b/use_xdg-open.patch new file mode 100644 index 000000000000..2e22efb26db4 --- /dev/null +++ b/use_xdg-open.patch @@ -0,0 +1,36 @@ +Description: use xdg-open to open things in external applications +Credits: novie + +diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +index 0531a5b45..0879fb232 100644 +--- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp ++++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include "platform/linux/specific_linux.h" + #include "storage/localstorage.h" + ++#include <QtCore/QProcess> + #include <QtGui/QDesktopServices> + + extern "C" { +@@ -65,6 +66,10 @@ QByteArray EscapeShell(const QByteArray &content) { + } // namespace internal + + void UnsafeOpenUrl(const QString &url) { ++ QProcess process; ++ process.startDetached(qsl("xdg-open"), {url}); ++ return; ++ + if (!g_app_info_launch_default_for_uri( + url.toUtf8(), + nullptr, +@@ -79,6 +84,9 @@ void UnsafeOpenEmailLink(const QString &email) { + + void UnsafeLaunch(const QString &filepath) { + const auto absolutePath = QFileInfo(filepath).absoluteFilePath(); ++ QProcess process; ++ process.startDetached(qsl("xdg-open"), {absolutePath}); ++ return; + + if (!g_app_info_launch_default_for_uri( + ("file://" + absolutePath).toUtf8(), |