Allow GNU/Linux maintainers to forward launcher name.

Use optional compiler directive -DTDESKTOP_LAUNCHER_FILENAME to forward
required XDG desktop file name.

If not specified, fallback to default value will be used.

Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
This commit is contained in:
Vitaly Zaitsev 2019-05-10 08:54:07 +02:00 committed by John Preston
parent 69960a47da
commit ddb9c84a1d
1 changed files with 4 additions and 2 deletions
Telegram/SourceFiles/core

View File

@ -241,8 +241,10 @@ void Launcher::init() {
QApplication::setApplicationName(qsl("TelegramDesktop"));
#ifdef TDESKTOP_FLATPAK_BUILD
QApplication::setDesktopFileName(qsl("org.telegram.desktop.desktop"));
#ifdef TDESKTOP_LAUNCHER_FILENAME
#define TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V) #V
#define TDESKTOP_LAUNCHER_FILENAME_TO_STRING(V) TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V)
QApplication::setDesktopFileName(qsl(TDESKTOP_LAUNCHER_FILENAME_TO_STRING(TDESKTOP_LAUNCHER_FILENAME)));
#elif defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QApplication::setDesktopFileName(qsl("telegramdesktop.desktop"));
#endif