From 9ee4ad95d0af25960791ba13cfd541fe30e93934 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 25 Nov 2022 21:33:29 +0400 Subject: [PATCH] Fix GApplication with some binary paths --- .../SourceFiles/platform/linux/specific_linux.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 6905619fa..48693c31c 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -514,6 +514,19 @@ bool GenerateDesktopFile( targetPath, md5Hash, AppName.utf16().replace(' ', '_'))); + + const auto d = QFile::encodeName(QDir(cWorkingDir()).absolutePath()); + hashMd5Hex(d.constData(), d.size(), md5Hash); + + if (!Core::Sandbox::Instance().customWorkingDir()) { + const auto exePath = QFile::encodeName( + cExeDir() + cExeName()); + hashMd5Hex(exePath.constData(), exePath.size(), md5Hash); + } + + QFile::remove(qsl("%1org.telegram.desktop.%2.desktop").arg( + targetPath, + md5Hash)); } return true; @@ -707,7 +720,7 @@ void start() { md5Hash.data()); } - return qsl("org.telegram.desktop.%1.desktop").arg(md5Hash); + return qsl("org.telegram.desktop._%1.desktop").arg(md5Hash); } return qsl("org.telegram.desktop.desktop");