2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Get rid of TDESKTOP_LAUNCHER_BASENAME

This key was mainly used to let flatpak and snap provide right desktop file name.
Now, we can compute it from the environment in runtime for both flatpak and snap.
There's no more need in this option. Desktop filename override by downstreams is highly discouraged.
This commit is contained in:
Ilya Fedin
2022-11-07 13:29:35 +04:00
committed by John Preston
parent a507edb67a
commit fc4682d77e
5 changed files with 15 additions and 16 deletions

View File

@@ -403,6 +403,17 @@ namespace Platform {
void start() {
QGuiApplication::setDesktopFileName([] {
if (KSandbox::isFlatpak()) {
return qEnvironmentVariable("FLATPAK_ID") + qsl(".desktop");
}
if (KSandbox::isSnap()) {
return qEnvironmentVariable("SNAP_INSTANCE_NAME")
+ '_'
+ cExeName()
+ qsl(".desktop");
}
if (!Core::UpdaterDisabled() && !cExeName().isEmpty()) {
const auto appimagePath = qsl("file://%1%2").arg(
cExeDir(),
@@ -419,7 +430,7 @@ void start() {
AppName.utf16().replace(' ', '_'));
}
return qsl(QT_STRINGIFY(TDESKTOP_LAUNCHER_BASENAME) ".desktop");
return qsl("telegramdesktop.desktop");
}());
LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));