[kde-workspace] Fix another bug in the systemd shutdown/restart patch (missing parameter)
Kevin Kofler
kkofler at fedoraproject.org
Wed Mar 14 03:25:06 UTC 2012
commit 7a94b6fe1dcf7e0e542116aa9a71a752ac58ee6f
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date: Wed Mar 14 04:23:52 2012 +0100
Fix another bug in the systemd shutdown/restart patch (missing parameter)
* Wed Mar 14 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.8.1-5
- fix another bug in the systemd shutdown/restart patch (missing parameter)
kde-workspace-4.8.0-systemd-shutdown.patch | 26 +++++++++++++++++---------
kde-workspace.spec | 5 ++++-
2 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/kde-workspace-4.8.0-systemd-shutdown.patch b/kde-workspace-4.8.0-systemd-shutdown.patch
index 4f450bc..1f2e9f1 100644
--- a/kde-workspace-4.8.0-systemd-shutdown.patch
+++ b/kde-workspace-4.8.0-systemd-shutdown.patch
@@ -15,7 +15,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/CMakeLists.txt kde-workspace-4.8.0-
qt4_add_dbus_interface( kworkspace_LIB_SRCS ${ksmserver_xml} ksmserver_interface )
diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp
--- kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp 2012-01-18 21:08:42.000000000 +0100
-+++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp 2012-03-13 15:52:49.000000000 +0100
++++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp 2012-03-14 04:19:46.000000000 +0100
@@ -40,6 +40,91 @@
#include <errno.h>
#include <stdio.h>
@@ -226,21 +226,29 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
}
if (DMType == OldKDM)
-@@ -330,8 +470,13 @@
+@@ -329,9 +469,21 @@
+ return;
if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
- // FIXME: entirely ignoring shutdownMode
+#ifdef KWORKSPACE_USE_SYSTEMD
++ // systemd supports only 2 modes:
++ // * interactive = true: brings up a PolicyKit prompt if other sessions are active
++ // * interactive = false: rejects the shutdown if other sessions are active
++ // There are no schedule or force modes.
++ // We try to map our 4 shutdown modes in the sanest way.
++ bool interactive = (shutdownMode == KWorkSpace::ShutdownModeInteractive
++ || shutdownMode == KWorkSpace::ShutdownModeForceNow);
+ SystemdManager().call(QLatin1String(
-+ shutdownType == KWorkSpace::ShutdownTypeReboot ? "Reboot" : "PowerOff"));
++ shutdownType == KWorkSpace::ShutdownTypeReboot ? "Reboot" : "PowerOff"), interactive);
+#else
+ // FIXME: entirely ignoring shutdownMode
CKManager().call(QLatin1String(
shutdownType == KWorkSpace::ShutdownTypeReboot ? "Restart" : "Stop"));
+#endif
return;
}
-@@ -406,12 +551,18 @@
+@@ -406,12 +558,18 @@
if (DMType == NewGDM || DMType == LightDM) {
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
@@ -259,7 +267,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
}
return false;
}
-@@ -469,6 +620,21 @@
+@@ -469,6 +627,21 @@
QDBusObjectPath currentSession, currentSeat;
if (getCurrentSeat(¤tSession, ¤tSeat)) {
foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
@@ -281,7 +289,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
CKSession lsess(sp);
if (lsess.isValid()) {
SessEnt se;
-@@ -484,6 +650,7 @@
+@@ -484,6 +657,7 @@
se.self = (sp == currentSession);
list.append(se);
}
@@ -289,7 +297,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
}
return true;
}
-@@ -567,6 +734,21 @@
+@@ -567,6 +741,21 @@
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
@@ -311,7 +319,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
CKSession lsess(sp);
if (lsess.isValid()) {
SessEnt se;
-@@ -578,6 +760,7 @@
+@@ -578,6 +767,7 @@
return true;
}
}
diff --git a/kde-workspace.spec b/kde-workspace.spec
index d3b71c9..11bc6eb 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -14,7 +14,7 @@
Summary: KDE Workspace
Name: kde-workspace
Version: 4.8.1
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2
URL: https://projects.kde.org/projects/kde/kde-workspace
@@ -976,6 +976,9 @@ fi
%changelog
+* Wed Mar 14 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.8.1-5
+- fix another bug in the systemd shutdown/restart patch (missing parameter)
+
* Tue Mar 13 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.8.1-4
- fix bugs in the systemd shutdown/restart patch
More information about the scm-commits
mailing list