From e632ac631eaa3583ad1e55293b9dec2197c8c00d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 1 Apr 2023 23:02:30 +0400 Subject: [PATCH] Add version check for abstract sockets --- Telegram/SourceFiles/core/sandbox.cpp | 4 ++-- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 45362220e..c9034e246 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -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, diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index ab1a50e2e..93fc23a99 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -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 IsDarkMode() {