From 0e3e0c5b8154e16c4a101ed1bf2fac4fec2b6952 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 2 Aug 2023 23:59:21 +0400 Subject: [PATCH] Do a D-Bus request instead of systemctl command for D-Bus config reload --- .../platform/linux/specific_linux.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 81ff88729..620b146e2 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -382,11 +382,18 @@ bool GenerateServiceFile(bool silent = false) { md5Hash)); } - QProcess::execute(u"systemctl"_q, { - u"--user"_q, - u"reload"_q, - u"dbus"_q, - }); + try { + const auto connection = Gio::DBus::Connection::get_sync( + Gio::DBus::BusType::SESSION); + + connection->call_sync( + base::Platform::DBus::kObjectPath, + base::Platform::DBus::kInterface, + "ReloadConfig", + {}, + base::Platform::DBus::kService); + } catch (...) { + } return true; }