Always ask for TDESKTOP_LAUNCHER_BASENAME on Linux.

This commit is contained in:
John Preston 2020-01-21 18:39:13 +03:00
parent f0dc912080
commit 48b24d12b2
5 changed files with 13 additions and 18 deletions

View File

@ -248,10 +248,8 @@ void Launcher::init() {
QApplication::setApplicationName(qsl("TelegramDesktop"));
#ifdef TDESKTOP_LAUNCHER_FILENAME
QApplication::setDesktopFileName(qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_FILENAME)));
#elif defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QApplication::setDesktopFileName(qsl("telegramdesktop.desktop"));
#if defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QApplication::setDesktopFileName(qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME)) + ".desktop");
#endif
#ifndef OS_MAC_OLD

View File

@ -548,10 +548,7 @@ void MainWindow::psFirstShow() {
auto snapName = QString::fromLatin1(qgetenv("SNAP_NAME"));
if(snapName.isEmpty()) {
std::vector<QString> possibleDesktopFiles = {
#ifdef TDESKTOP_LAUNCHER_FILENAME
MACRO_TO_STRING(TDESKTOP_LAUNCHER_FILENAME),
#endif // TDESKTOP_LAUNCHER_FILENAME
"telegramdesktop.desktop",
MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME) + ".desktop",
"Telegram.desktop"
};

View File

@ -145,13 +145,8 @@ NotificationData::NotificationData(
_hints["category"] = qsl("im.received");
#ifdef TDESKTOP_LAUNCHER_FILENAME
_hints["desktop-entry"] =
qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_FILENAME))
.remove(QRegExp(qsl("\\.desktop$"), Qt::CaseInsensitive));
#else
_hints["desktop-entry"] = qsl("telegramdesktop");
#endif
qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME));
connect(_notificationInterface.get(),
SIGNAL(NotificationClosed(uint, uint)),

View File

@ -13,7 +13,7 @@ option(TDESKTOP_USE_PACKAGED_TGVOIP "Find libtgvoip using CMake instead of bundl
option(TDESKTOP_API_TEST "Use test API credentials." OFF)
set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.")
set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.")
set(TDESKTOP_LAUNCHER_FILENAME "" CACHE STRING "Use custom desktop file name (Linux only).")
set(TDESKTOP_LAUNCHER_BASENAME "" CACHE STRING "Desktop file base name (Linux only).")
if (TDESKTOP_API_TEST)
set(TDESKTOP_API_ID 17349)
@ -85,6 +85,11 @@ if (TDESKTOP_DISABLE_GTK_INTEGRATION)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_GTK_INTEGRATION)
endif()
if (TDESKTOP_LAUNCHER_FILENAME)
target_compile_definitions(Telegram PRIVATE TDESKTOP_LAUNCHER_FILENAME=${TDESKTOP_LAUNCHER_FILENAME})
if (NOT TDESKTOP_LAUNCHER_BASENAME)
if (NOT DESKTOP_APP_USE_PACKAGED)
set(TDESKTOP_LAUNCHER_BASENAME "telegramdesktop")
elseif (LINUX)
message(FATAL_ERROR "Please provide .desktop file base name (-D TDESKTOP_LAUNCHER_BASENAME=[basename]).")
endif()
endif()
target_compile_definitions(Telegram PRIVATE TDESKTOP_LAUNCHER_BASENAME=${TDESKTOP_LAUNCHER_BASENAME})

@ -1 +1 @@
Subproject commit 9f8f5465d2178c5c0df9f0f0e93de87798e7237a
Subproject commit db99f556f328f8e1fdc44ab30041f655b68b8312