Do a D-Bus request instead of systemctl command for D-Bus config reload

This commit is contained in:
Ilya Fedin 2023-08-02 23:59:21 +04:00 committed by John Preston
parent da55698a51
commit 0e3e0c5b81
1 changed files with 12 additions and 5 deletions

View File

@ -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;
}