|
|
|
@ -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>
|
|
|
|
|
Date: Fri, 1 Sep 2023 17:09:16 -0700
|
|
|
|
|
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>
|
|
|
|
|
---
|
|
|
|
|
daemon/powerdevilcore.cpp | 4 +++-
|
|
|
|
|
daemon/powerdevilpowermanagement.cpp | 17 +++++++++++++++++
|
|
|
|
|
daemon/powerdevilpowermanagement.cpp | 21 +++++++++++++++++++++
|
|
|
|
|
daemon/powerdevilpowermanagement.h | 1 +
|
|
|
|
|
daemon/powerdevilprofilegenerator.cpp | 17 ++++++++++-------
|
|
|
|
|
daemon/powerdevilprofilegenerator.h | 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
|
|
|
|
|
index 0791552c..5c4f8a7d 100644
|
|
|
|
@ -42,7 +42,7 @@ index 0791552c..5c4f8a7d 100644
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/daemon/powerdevilpowermanagement.cpp b/daemon/powerdevilpowermanagement.cpp
|
|
|
|
|
index 7b8e8d5d..ca4c9f07 100644
|
|
|
|
|
index 7b8e8d5d..573a6a7d 100644
|
|
|
|
|
--- a/daemon/powerdevilpowermanagement.cpp
|
|
|
|
|
+++ b/daemon/powerdevilpowermanagement.cpp
|
|
|
|
|
@@ -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 <QDBusConnectionInterface>
|
|
|
|
|
@@ -217,6 +218,22 @@ void PowerManagement::suspendThenHibernate()
|
|
|
|
|
@@ -217,6 +218,26 @@ void PowerManagement::suspendThenHibernate()
|
|
|
|
|
QDBusConnection::sessionBus().asyncCall(message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+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"),
|
|
|
|
|
+ QStringLiteral("/org/freedesktop/systemd1"),
|
|
|
|
|
+ QStringLiteral("org.freedesktop.DBus.Properties"),
|
|
|
|
|