Always ask for TDESKTOP_LAUNCHER_BASENAME on Linux.
This commit is contained in:
		
							parent
							
								
									f0dc912080
								
							
						
					
					
						commit
						48b24d12b2
					
				
					 5 changed files with 13 additions and 18 deletions
				
			
		| 
						 | 
					@ -248,10 +248,8 @@ void Launcher::init() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QApplication::setApplicationName(qsl("TelegramDesktop"));
 | 
						QApplication::setApplicationName(qsl("TelegramDesktop"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef TDESKTOP_LAUNCHER_FILENAME
 | 
					#if defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
 | 
				
			||||||
	QApplication::setDesktopFileName(qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_FILENAME)));
 | 
						QApplication::setDesktopFileName(qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME)) + ".desktop");
 | 
				
			||||||
#elif defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
 | 
					 | 
				
			||||||
	QApplication::setDesktopFileName(qsl("telegramdesktop.desktop"));
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef OS_MAC_OLD
 | 
					#ifndef OS_MAC_OLD
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -548,10 +548,7 @@ void MainWindow::psFirstShow() {
 | 
				
			||||||
		auto snapName = QString::fromLatin1(qgetenv("SNAP_NAME"));
 | 
							auto snapName = QString::fromLatin1(qgetenv("SNAP_NAME"));
 | 
				
			||||||
		if(snapName.isEmpty()) {
 | 
							if(snapName.isEmpty()) {
 | 
				
			||||||
			std::vector<QString> possibleDesktopFiles = {
 | 
								std::vector<QString> possibleDesktopFiles = {
 | 
				
			||||||
#ifdef TDESKTOP_LAUNCHER_FILENAME
 | 
									MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME) + ".desktop",
 | 
				
			||||||
				MACRO_TO_STRING(TDESKTOP_LAUNCHER_FILENAME),
 | 
					 | 
				
			||||||
#endif // TDESKTOP_LAUNCHER_FILENAME
 | 
					 | 
				
			||||||
				"telegramdesktop.desktop",
 | 
					 | 
				
			||||||
				"Telegram.desktop"
 | 
									"Telegram.desktop"
 | 
				
			||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -145,13 +145,8 @@ NotificationData::NotificationData(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	_hints["category"] = qsl("im.received");
 | 
						_hints["category"] = qsl("im.received");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef TDESKTOP_LAUNCHER_FILENAME
 | 
					 | 
				
			||||||
	_hints["desktop-entry"] =
 | 
						_hints["desktop-entry"] =
 | 
				
			||||||
		qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_FILENAME))
 | 
							qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME));
 | 
				
			||||||
			.remove(QRegExp(qsl("\\.desktop$"), Qt::CaseInsensitive));
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	_hints["desktop-entry"] = qsl("telegramdesktop");
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	connect(_notificationInterface.get(),
 | 
						connect(_notificationInterface.get(),
 | 
				
			||||||
		SIGNAL(NotificationClosed(uint, uint)),
 | 
							SIGNAL(NotificationClosed(uint, uint)),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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)
 | 
					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_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_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)
 | 
					if (TDESKTOP_API_TEST)
 | 
				
			||||||
    set(TDESKTOP_API_ID 17349)
 | 
					    set(TDESKTOP_API_ID 17349)
 | 
				
			||||||
| 
						 | 
					@ -85,6 +85,11 @@ if (TDESKTOP_DISABLE_GTK_INTEGRATION)
 | 
				
			||||||
    target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_GTK_INTEGRATION)
 | 
					    target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_GTK_INTEGRATION)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (TDESKTOP_LAUNCHER_FILENAME)
 | 
					if (NOT TDESKTOP_LAUNCHER_BASENAME)
 | 
				
			||||||
    target_compile_definitions(Telegram PRIVATE TDESKTOP_LAUNCHER_FILENAME=${TDESKTOP_LAUNCHER_FILENAME})
 | 
					    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()
 | 
					endif()
 | 
				
			||||||
 | 
					target_compile_definitions(Telegram PRIVATE TDESKTOP_LAUNCHER_BASENAME=${TDESKTOP_LAUNCHER_BASENAME})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
Subproject commit 9f8f5465d2178c5c0df9f0f0e93de87798e7237a
 | 
					Subproject commit db99f556f328f8e1fdc44ab30041f655b68b8312
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue