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

View file

@ -382,11 +382,18 @@ bool GenerateServiceFile(bool silent = false) {
md5Hash)); md5Hash));
} }
QProcess::execute(u"systemctl"_q, { try {
u"--user"_q, const auto connection = Gio::DBus::Connection::get_sync(
u"reload"_q, Gio::DBus::BusType::SESSION);
u"dbus"_q,
}); connection->call_sync(
base::Platform::DBus::kObjectPath,
base::Platform::DBus::kInterface,
"ReloadConfig",
{},
base::Platform::DBus::kService);
} catch (...) {
}
return true; return true;
} }