Use SNAP_INSTANCE_NAME in SingleInstanceLocalServerName

That's what snapd's apparmor profiles use
This commit is contained in:
Ilya Fedin 2023-09-14 00:12:32 +04:00 committed by John Preston
parent 94feb953aa
commit 0b4a255acc
1 changed files with 4 additions and 1 deletions

View File

@ -452,7 +452,10 @@ void SetApplicationIcon(const QIcon &icon) {
QString SingleInstanceLocalServerName(const QString &hash) {
#if defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
if (KSandbox::isSnap()) {
return u"snap.telegram-desktop."_q + hash;
return u"snap."_q
+ qEnvironmentVariable("SNAP_INSTANCE_NAME")
+ '.'
+ hash;
}
return hash + '-' + cGUIDStr();
#else // Q_OS_LINUX && Qt >= 6.2.0