[kde-workspace] Fix bugs in the systemd shutdown/restart patch
Kevin Kofler
kkofler at fedoraproject.org
Tue Mar 13 14:57:30 UTC 2012
commit 520048485ff1b90515d03282083dac814565f0a9
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date: Tue Mar 13 15:57:18 2012 +0100
Fix bugs in the systemd shutdown/restart patch
* Mon Mar 12 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.8.1-4
- fix bugs in the systemd shutdown/restart patch
kde-workspace-4.8.0-systemd-shutdown.patch | 24 +++++++++++++-----------
kde-workspace.spec | 5 ++++-
2 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/kde-workspace-4.8.0-systemd-shutdown.patch b/kde-workspace-4.8.0-systemd-shutdown.patch
index 800fbee..4f450bc 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-12 19:49:26.000000000 +0100
++++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp 2012-03-13 15:52:49.000000000 +0100
@@ -40,6 +40,91 @@
#include <errno.h>
#include <stdio.h>
@@ -78,7 +78,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
+ SystemdManager() :
+ QDBusInterface(
+ QLatin1String("org.freedesktop.login1"),
-+ QLatin1String("/org/freedesktop/login1/Manager"),
++ QLatin1String("/org/freedesktop/login1"),
+ QLatin1String("org.freedesktop.login1.Manager"),
+ QDBusConnection::systemBus()) {}
+};
@@ -205,7 +205,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
static void getSessionLocation(CKSession &lsess, SessEnt &se)
{
QString tty;
-@@ -291,13 +425,18 @@
+@@ -291,14 +425,20 @@
}
se.vt = tty.mid(strlen("/dev/tty")).toInt();
}
@@ -217,14 +217,16 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
{
if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
+#ifdef KWORKSPACE_USE_SYSTEMD
-+ QDBusReply<bool> canStop = SystemdManager().call(QLatin1String("CanPowerOff"));
++ QDBusReply<QString> canPowerOff = SystemdManager().call(QLatin1String("CanPowerOff"));
++ return (canPowerOff.isValid() && canPowerOff.value() != QLatin1String("no"));
+#else
QDBusReply<bool> canStop = CKManager().call(QLatin1String("CanStop"));
-+#endif
return (canStop.isValid() && canStop.value());
++#endif
}
-@@ -330,8 +469,13 @@
+ if (DMType == OldKDM)
+@@ -330,8 +470,13 @@
if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
// FIXME: entirely ignoring shutdownMode
@@ -238,7 +240,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
return;
}
-@@ -406,12 +550,18 @@
+@@ -406,12 +551,18 @@
if (DMType == NewGDM || DMType == LightDM) {
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
@@ -257,7 +259,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
}
return false;
}
-@@ -469,6 +619,21 @@
+@@ -469,6 +620,21 @@
QDBusObjectPath currentSession, currentSeat;
if (getCurrentSeat(¤tSession, ¤tSeat)) {
foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
@@ -279,7 +281,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 +649,7 @@
+@@ -484,6 +650,7 @@
se.self = (sp == currentSession);
list.append(se);
}
@@ -287,7 +289,7 @@ diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp kde-workspace-4
}
return true;
}
-@@ -567,6 +733,21 @@
+@@ -567,6 +734,21 @@
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
@@ -309,7 +311,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 +759,7 @@
+@@ -578,6 +760,7 @@
return true;
}
}
diff --git a/kde-workspace.spec b/kde-workspace.spec
index 506b2c4..132d25f 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -14,7 +14,7 @@
Summary: KDE Workspace
Name: kde-workspace
Version: 4.8.1
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv2
URL: https://projects.kde.org/projects/kde/kde-workspace
@@ -976,6 +976,9 @@ fi
%changelog
+* Mon Mar 12 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.8.1-4
+- fix bugs in the systemd shutdown/restart patch
+
* Mon Mar 12 2012 Rex Dieter <rdieter at fedoraproject.org> 4.8.1-3
- Port shutdown/restart code from ConsoleKit to systemd (#788171)
More information about the scm-commits
mailing list