Add version check for abstract sockets

This commit is contained in:
Ilya Fedin 2023-04-01 23:02:30 +04:00 committed by John Preston
parent 3064a41014
commit e632ac631e
2 changed files with 5 additions and 5 deletions

View file

@ -122,9 +122,9 @@ int Sandbox::start() {
}
}
#ifdef Q_OS_LINUX
#if defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
_localServer.setSocketOptions(QLocalServer::AbstractNamespaceOption);
#endif
#endif // Q_OS_LINUX && Qt >= 6.2.0
connect(
&_localSocket,

View file

@ -565,14 +565,14 @@ void SetApplicationIcon(const QIcon &icon) {
}
QString SingleInstanceLocalServerName(const QString &hash) {
#ifdef Q_OS_LINUX
#if defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
if (KSandbox::isSnap()) {
return u"snap.telegram-desktop."_q + hash;
}
return hash + '-' + cGUIDStr();
#else // Q_OS_LINUX
#else // Q_OS_LINUX && Qt >= 6.2.0
return QDir::tempPath() + '/' + hash + '-' + cGUIDStr();
#endif // !Q_OS_LINUX
#endif // !Q_OS_LINUX || Qt < 6.2.0
}
std::optional<bool> IsDarkMode() {