From 1ac155e630dd8d9718e5a34039f5ea50499993e4 Mon Sep 17 00:00:00 2001 From: Reion Wong Date: Wed, 2 Sep 2026 09:25:25 -0400 Subject: [PATCH] fix(session): repair systemd power action calls --- session/application.h | 8 ++++---- session/powermanager/powerproviders.cpp | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/session/application.h b/session/application.h index c4ecf91..3d595a6 100644 --- a/session/application.h +++ b/session/application.h @@ -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() { diff --git a/session/powermanager/powerproviders.cpp b/session/powermanager/powerproviders.cpp index 89598e1..bd7a5cb 100644 --- a/session/powermanager/powerproviders.cpp +++ b/session/powermanager/powerproviders.cpp @@ -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);