diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index 0e74a5664..02ba16b1e 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -51,22 +51,10 @@ inline QList GetMimeUrls(const QMimeData *data) { } #endif -#if __has_include() && defined DeclareReadSetting -inline QString FlatpakID() { - static const auto Result = [] { - if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) { - return qEnvironmentVariable("FLATPAK_ID"); - } else { - return cExeName(); - } - }(); - - return Result; -} - +#if __has_include() inline QString IconName() { static const auto Result = KSandbox::isFlatpak() - ? FlatpakID() + ? qEnvironmentVariable("FLATPAK_ID") : qsl("telegram"); return Result; } diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 28e0dc5ee..6a63aff42 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -247,29 +247,6 @@ bool GenerateDesktopFile( } } -QString AppRuntimeDirectory() { - static const auto Result = [&] { - auto runtimeDir = QStandardPaths::writableLocation( - QStandardPaths::RuntimeLocation); - - if (KSandbox::isFlatpak()) { - runtimeDir += qsl("/app/") + base::FlatpakID(); - } - - if (!QFileInfo::exists(runtimeDir)) { // non-systemd distros - runtimeDir = QDir::tempPath(); - } - - if (!runtimeDir.endsWith('/')) { - runtimeDir += '/'; - } - - return runtimeDir; - }(); - - return Result; -} - } // namespace void SetApplicationIcon(const QIcon &icon) { @@ -277,16 +254,7 @@ void SetApplicationIcon(const QIcon &icon) { } QString SingleInstanceLocalServerName(const QString &hash) { - const auto idealSocketPath = AppRuntimeDirectory() - + hash - + '-' - + cGUIDStr(); - - if ((idealSocketPath.size() + 1) >= sizeof(sockaddr_un().sun_path)) { - return AppRuntimeDirectory() + hash; - } else { - return idealSocketPath; - } + return QDir::tempPath() + '/' + hash + '-' + cGUIDStr(); } std::optional IsDarkMode() { diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 70a690949..3dd24bd70 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -119,7 +119,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/basic_types.h" #include "logs.h" -#include "settings.h" #include "core/utils.h" #include "config.h"