fix(session): repair systemd power action calls

main
Reion Wong 3 weeks ago
parent 5b37ae3b28
commit 1ac155e630

@ -39,13 +39,13 @@ public slots:
}
void reboot() {
m_power.reboot();
QCoreApplication::exit(0);
if (m_power.reboot())
QCoreApplication::exit(0);
}
void powerOff() {
m_power.shutdown();
QCoreApplication::exit(0);
if (m_power.shutdown())
QCoreApplication::exit(0);
}
bool suspend() {

@ -126,7 +126,9 @@ static bool dbusCallSystemd(const QString &service,
return false;
}
QDBusMessage msg = dbus.call(method, needBoolArg ? QVariant(true) : QVariant());
const QDBusMessage msg = needBoolArg
? dbus.call(method, QVariant(true))
: dbus.call(method);
if (!msg.errorName().isEmpty()) {
printDBusMsg(msg);

Loading…
Cancel
Save