Update patch again to check systemd interface is there

epel9
Adam Williamson 1 year ago
parent 62825569db
commit 664e23d902

@ -1,4 +1,4 @@
From 795ac6b8b40cd882235adeed4c83356d1ca79f61 Mon Sep 17 00:00:00 2001 From 5a523543de6bffc0f6d78eab1a6bf27c1454d752 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com> From: Adam Williamson <awilliam@redhat.com>
Date: Fri, 1 Sep 2023 17:09:16 -0700 Date: Fri, 1 Sep 2023 17:09:16 -0700
Subject: [PATCH] profiledefaults: don't automatically suspend by default if Subject: [PATCH] profiledefaults: don't automatically suspend by default if
@ -11,12 +11,12 @@ from Natalie Clarius, rebased on 5.27.7.
Signed-off-by: Adam Williamson <awilliam@redhat.com> Signed-off-by: Adam Williamson <awilliam@redhat.com>
--- ---
daemon/powerdevilcore.cpp | 4 +++- daemon/powerdevilcore.cpp | 4 +++-
daemon/powerdevilpowermanagement.cpp | 17 +++++++++++++++++ daemon/powerdevilpowermanagement.cpp | 21 +++++++++++++++++++++
daemon/powerdevilpowermanagement.h | 1 + daemon/powerdevilpowermanagement.h | 1 +
daemon/powerdevilprofilegenerator.cpp | 17 ++++++++++------- daemon/powerdevilprofilegenerator.cpp | 17 ++++++++++-------
daemon/powerdevilprofilegenerator.h | 2 +- daemon/powerdevilprofilegenerator.h | 2 +-
kcmodule/profiles/EditPage.cpp | 2 ++ kcmodule/profiles/EditPage.cpp | 2 ++
6 files changed, 34 insertions(+), 9 deletions(-) 6 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp
index 0791552c..5c4f8a7d 100644 index 0791552c..5c4f8a7d 100644
@ -42,7 +42,7 @@ index 0791552c..5c4f8a7d 100644
} }
diff --git a/daemon/powerdevilpowermanagement.cpp b/daemon/powerdevilpowermanagement.cpp diff --git a/daemon/powerdevilpowermanagement.cpp b/daemon/powerdevilpowermanagement.cpp
index 7b8e8d5d..ca4c9f07 100644 index 7b8e8d5d..573a6a7d 100644
--- a/daemon/powerdevilpowermanagement.cpp --- a/daemon/powerdevilpowermanagement.cpp
+++ b/daemon/powerdevilpowermanagement.cpp +++ b/daemon/powerdevilpowermanagement.cpp
@@ -19,6 +19,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. @@ -19,6 +19,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
@ -53,12 +53,16 @@ index 7b8e8d5d..ca4c9f07 100644
#include <QDBusConnection> #include <QDBusConnection>
#include <QDBusConnectionInterface> #include <QDBusConnectionInterface>
@@ -217,6 +218,22 @@ void PowerManagement::suspendThenHibernate() @@ -217,6 +218,26 @@ void PowerManagement::suspendThenHibernate()
QDBusConnection::sessionBus().asyncCall(message); QDBusConnection::sessionBus().asyncCall(message);
} }
+bool PowerManagement::isVirtualMachine() +bool PowerManagement::isVirtualMachine()
+{ +{
+ if (!QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.systemd1"))) {
+ // can't check, fall back to assuming false
+ return false;
+ }
+ QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"), + QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"),
+ QStringLiteral("/org/freedesktop/systemd1"), + QStringLiteral("/org/freedesktop/systemd1"),
+ QStringLiteral("org.freedesktop.DBus.Properties"), + QStringLiteral("org.freedesktop.DBus.Properties"),

@ -2,7 +2,7 @@
Name: powerdevil Name: powerdevil
Version: 5.27.7 Version: 5.27.7
Release: 4%{?dist} Release: 5%{?dist}
Summary: Manages the power consumption settings of a Plasma Shell Summary: Manages the power consumption settings of a Plasma Shell
License: GPLv2+ License: GPLv2+
@ -140,6 +140,9 @@ rm -fv %{buildroot}/%{_libdir}/libpowerdevil{configcommonprivate,core,ui}.so
%{_kf5_qtplugindir}/powerdevil/action/powerdevil_*.so %{_kf5_qtplugindir}/powerdevil/action/powerdevil_*.so
%changelog %changelog
* Mon Sep 04 2023 Adam Williamson <awilliam@redhat.com> - 5.27.7-5
- Update patch again to check systemd interface is there
* Sun Sep 03 2023 Adam Williamson <awilliam@redhat.com> - 5.27.7-4 * Sun Sep 03 2023 Adam Williamson <awilliam@redhat.com> - 5.27.7-4
- Update patch again to also disable lid suspend on VMs (per Natalie) - Update patch again to also disable lid suspend on VMs (per Natalie)

Loading…
Cancel
Save