2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Unified function to detect icon name on Linux

This commit is contained in:
Ilya Fedin
2020-02-26 15:38:31 +04:00
committed by John Preston
parent 3b300f23e1
commit 7bd0598555
5 changed files with 17 additions and 13 deletions

View File

@@ -44,6 +44,7 @@ namespace {
constexpr auto kDesktopFile = ":/misc/telegramdesktop.desktop"_cs;
constexpr auto kSnapLauncherDir = "/var/lib/snapd/desktop/applications/"_cs;
constexpr auto kIconName = "telegram"_cs;
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
void SandboxAutostart(bool autostart, bool silent = false) {
@@ -333,6 +334,13 @@ QString GetLauncherFilename() {
return LauncherFilename;
}
QString GetIconName() {
static const auto IconName = InSandbox()
? GetLauncherBasename()
: kIconName.utf16();
return IconName;
}
} // namespace Platform
namespace {