mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Do a D-Bus request instead of systemctl command for D-Bus config reload
This commit is contained in:
parent
da55698a51
commit
0e3e0c5b81
1 changed files with 12 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue