rpms/kdebase-workspace/F-11 kdebase-workspace-4.2.85-ck-shutdown.patch, 1.2, 1.3 kdebase-workspace.spec, 1.255, 1.256
Kevin Kofler
kkofler at fedoraproject.org
Tue Feb 9 13:26:44 UTC 2010
Author: kkofler
Update of /cvs/pkgs/rpms/kdebase-workspace/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20112/F-11
Modified Files:
kdebase-workspace.spec
Added Files:
kdebase-workspace-4.2.85-ck-shutdown.patch
Log Message:
* Tue Feb 09 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.3.5-2.1
- use old ck-shutdown patch without the CanStop check on F11 (#562851)
kdebase-workspace-4.2.85-ck-shutdown.patch:
kdisplaymanager.cpp | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
Index: kdebase-workspace-4.2.85-ck-shutdown.patch
===================================================================
RCS file: kdebase-workspace-4.2.85-ck-shutdown.patch
diff -N kdebase-workspace-4.2.85-ck-shutdown.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ kdebase-workspace-4.2.85-ck-shutdown.patch 9 Feb 2010 13:26:44 -0000 1.3
@@ -0,0 +1,63 @@
+diff -up kdebase-workspace-4.2.85/libs/kworkspace/kdisplaymanager.cpp.ck-shutdown kdebase-workspace-4.2.85/libs/kworkspace/kdisplaymanager.cpp
+--- kdebase-workspace-4.2.85/libs/kworkspace/kdisplaymanager.cpp.ck-shutdown 2009-04-28 15:46:11.000000000 +0200
++++ kdebase-workspace-4.2.85/libs/kworkspace/kdisplaymanager.cpp 2009-05-11 22:49:41.000000000 +0200
+@@ -26,6 +26,7 @@
+ #include <QtDBus/QtDBus>
+
+ #include <QRegExp>
++#include <QLatin1String>
+
+ #include <X11/Xauth.h>
+ #include <X11/Xlib.h>
+@@ -85,6 +86,7 @@ KDisplayManager::KDisplayManager() : d(n
+ strcpy( sa.sun_path, "/tmp/.gdm_socket" );
+ if (::connect( d->fd, (struct sockaddr *)&sa, sizeof(sa) )) {
+ ::close( d->fd );
++ DMType = NoDM;
+ d->fd = -1;
+ break;
+ }
+@@ -186,6 +188,21 @@ KDisplayManager::exec( const char *cmd,
+ bool
+ KDisplayManager::canShutdown()
+ {
++ if (DMType == NoDM) {
++ // No DM or newest GDM running, we'll try shutting down through ConsoleKit.
++ // Unfortunately, ConsoleKit won't tell us if we're allowed to do that
++ // (it also depends on whether there are other users logged in on the
++ // system), so we can only check if it's running at all.
++ QDBusConnection systemBus = QDBusConnection::systemBus();
++ if (!systemBus.isConnected())
++ return false;
++ QDBusInterface consoleKit( QLatin1String( "org.freedesktop.ConsoleKit" ),
++ QLatin1String( "/org/freedesktop/ConsoleKit/Manager" ),
++ QLatin1String( "org.freedesktop.ConsoleKit.Manager" ),
++ systemBus );
++ return consoleKit.isValid();
++ }
++
+ if (DMType == OldKDM)
+ return strstr( ctl, ",maysd" ) != 0;
+
+@@ -205,6 +222,21 @@ KDisplayManager::shutdown( KWorkSpace::S
+ if (shutdownType == KWorkSpace::ShutdownTypeNone || shutdownType == KWorkSpace::ShutdownTypeLogout)
+ return;
+
++ if (DMType == NoDM) {
++ // No DM or newest GDM running, try shutting down through ConsoleKit.
++ QDBusConnection systemBus = QDBusConnection::systemBus();
++ if (!systemBus.isConnected())
++ return;
++ QDBusInterface consoleKit( QLatin1String( "org.freedesktop.ConsoleKit" ),
++ QLatin1String( "/org/freedesktop/ConsoleKit/Manager" ),
++ QLatin1String( "org.freedesktop.ConsoleKit.Manager" ),
++ systemBus );
++ if (consoleKit.isValid())
++ consoleKit.call( QLatin1String( shutdownType == KWorkSpace::ShutdownTypeReboot ?
++ "Restart" : "Stop" ) );
++ return;
++ }
++
+ bool cap_ask;
+ if (DMType == NewKDM) {
+ QByteArray re;
Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/F-11/kdebase-workspace.spec,v
retrieving revision 1.255
retrieving revision 1.256
diff -u -p -r1.255 -r1.256
--- kdebase-workspace.spec 30 Jan 2010 17:38:04 -0000 1.255
+++ kdebase-workspace.spec 9 Feb 2010 13:26:44 -0000 1.256
@@ -7,7 +7,7 @@
Summary: K Desktop Environment - Workspace
Name: kdebase-workspace
Version: 4.3.5
-Release: 2%{?dist}
+Release: 2%{?dist}.1
Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
License: GPLv2
@@ -18,7 +18,13 @@ BuildRoot: %{_tmppath}/%{name}-%{version
Patch1: kdebase-workspace-4.2.96-redhat-startkde.patch
Patch2: kdebase-workspace-4.2.95-plasma-konsole.patch
Patch3: kdebase-workspace-4.2.90-show_systemsettings.patch
+%if 0%{?fedora} > 11 || !0%{?fedora}
Patch4: kdebase-workspace-4.3.95-ck-shutdown.patch
+%else
+# old version of the patch without the CanStop check for F11
+# CanStop was added with the PolicyKit1 port of ConsoleKit (0.4.x)
+Patch4: kdebase-workspace-4.2.85-ck-shutdown.patch
+%endif
# 441062: packagekit tools do not show icons correctly on KDE
Patch7: kdebase-workspace-4.0.3-krdb.patch
Patch8: kdebase-workspace-4.2.85-klipper-url.patch
@@ -617,6 +623,9 @@ fi
%changelog
+* Tue Feb 09 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.3.5-2.1
+- use old ck-shutdown patch without the CanStop check on F11 (#562851)
+
* Sat Jan 30 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.3.5-2
- ck-shutdown: don't offer shutdown/restart when not allowed by CK (#529644)
More information about the scm-commits
mailing list