2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Fix name of the snap desktop file

Use new switch for GSL
This commit is contained in:
Ilya Fedin
2020-02-10 07:58:57 +04:00
committed by John Preston
parent fb2bbd87b7
commit 77719750ee
2 changed files with 16 additions and 24 deletions

View File

@@ -264,22 +264,23 @@ QString SingleInstanceLocalServerName(const QString &hash) {
QString GetLauncherBasename() {
static const auto LauncherBasename = [&] {
QString launcherBasename;
if (InSnap()) {
launcherBasename = qsl("%1_%2")
.arg(QString::fromLatin1(qgetenv("SNAP_NAME")))
.arg(qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME)));
LOG(("SNAP Environment detected, "
"launcher filename is %1.desktop")
.arg(launcherBasename));
} else {
launcherBasename =
qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME));
if (!InSnap()) {
return qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME));
}
return launcherBasename;
const auto snapNameKey =
qEnvironmentVariableIsSet("SNAP_INSTANCE_NAME")
? "SNAP_INSTANCE_NAME"
: "SNAP_NAME";
const auto result = qsl("%1_%2")
.arg(QString::fromLatin1(snapNameKey))
.arg(cExeName());
LOG(("SNAP Environment detected, launcher filename is %1.desktop")
.arg(result));
return result;
}();
return LauncherBasename;