2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use KSandbox to check flatpak/snap environment

This commit is contained in:
Ilya Fedin
2022-09-19 06:17:37 +04:00
committed by John Preston
parent 89879e355d
commit 5132fd5010
5 changed files with 16 additions and 31 deletions

View File

@@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <KSandbox>
extern "C" {
#include <openssl/rsa.h>
@@ -1634,16 +1635,14 @@ void UpdateApplication() {
return "https://www.microsoft.com/en-us/store/p/telegram-desktop/9nztwsqntd0s";
#elif defined OS_MAC_STORE // OS_WIN_STORE
return "https://itunes.apple.com/ae/app/telegram-desktop/id946399090";
#elif defined Q_OS_UNIX && !defined Q_OS_MAC // OS_WIN_STORE || OS_MAC_STORE
if (Platform::InFlatpak()) {
#else // OS_WIN_STORE || OS_MAC_STORE
if (KSandbox::isFlatpak()) {
return "https://flathub.org/apps/details/org.telegram.desktop";
} else if (Platform::InSnap()) {
} else if (KSandbox::isSnap()) {
return "https://snapcraft.io/telegram-desktop";
}
return "https://desktop.telegram.org";
#else // OS_WIN_STORE || OS_MAC_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC)
return "https://desktop.telegram.org";
#endif // OS_WIN_STORE || OS_MAC_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC)
#endif // OS_WIN_STORE || OS_MAC_STORE
}();
UrlClickHandler::Open(url);
} else {