rpms/kdebase-workspace/F-12 kdebase-workspace-4.3.95-ck-shutdown.patch, NONE, 1.1 kdebase-workspace.spec, 1.319, 1.320 kdebase-workspace-4.2.85-ck-shutdown.patch, 1.1, NONE
Kevin Kofler
kkofler at fedoraproject.org
Sat Jan 30 17:38:05 UTC 2010
Author: kkofler
Update of /cvs/pkgs/rpms/kdebase-workspace/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7530/F-12
Modified Files:
kdebase-workspace.spec
Added Files:
kdebase-workspace-4.3.95-ck-shutdown.patch
Removed Files:
kdebase-workspace-4.2.85-ck-shutdown.patch
Log Message:
* 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)
kdebase-workspace-4.3.95-ck-shutdown.patch:
kdisplaymanager.cpp | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
--- NEW FILE kdebase-workspace-4.3.95-ck-shutdown.patch ---
diff -ur kdebase-workspace-4.3.95/libs/kworkspace/kdisplaymanager.cpp kdebase-workspace-4.3.95-ck-shutdown/libs/kworkspace/kdisplaymanager.cpp
--- kdebase-workspace-4.3.95/libs/kworkspace/kdisplaymanager.cpp 2009-04-28 15:46:11.000000000 +0200
+++ kdebase-workspace-4.3.95-ck-shutdown/libs/kworkspace/kdisplaymanager.cpp 2010-01-30 17:31:58.000000000 +0100
@@ -26,6 +26,7 @@
#include <QtDBus/QtDBus>
#include <QRegExp>
+#include <QLatin1String>
#include <X11/Xauth.h>
#include <X11/Xlib.h>
@@ -85,6 +86,7 @@
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,23 @@
bool
KDisplayManager::canShutdown()
{
+ if (DMType == NoDM) {
+ // No DM or newest GDM running, we'll try shutting down through ConsoleKit.
+ 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 );
+ if (!consoleKit.isValid())
+ return false;
+ // Unfortunately, at this point we don't know whether we should be querying
+ // CanStop or CanRestart. Let's do what the code below does and just use CanStop.
+ QDBusReply<bool> canStop = consoleKit.call( QLatin1String( "CanStop" ) );
+ return (canStop.isValid() && canStop.value());
+ }
+
if (DMType == OldKDM)
return strstr( ctl, ",maysd" ) != 0;
@@ -205,6 +224,21 @@
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-12/kdebase-workspace.spec,v
retrieving revision 1.319
retrieving revision 1.320
diff -u -p -r1.319 -r1.320
--- kdebase-workspace.spec 22 Jan 2010 19:23:12 -0000 1.319
+++ kdebase-workspace.spec 30 Jan 2010 17:38:05 -0000 1.320
@@ -7,7 +7,7 @@
Summary: K Desktop Environment - Workspace
Name: kdebase-workspace
Version: 4.3.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
License: GPLv2
@@ -18,7 +18,7 @@ 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
-Patch4: kdebase-workspace-4.2.85-ck-shutdown.patch
+Patch4: kdebase-workspace-4.3.95-ck-shutdown.patch
# 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 +617,9 @@ fi
%changelog
+* 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)
+
* Fri Jan 22 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.3.5-1
- 4.3.5
--- kdebase-workspace-4.2.85-ck-shutdown.patch DELETED ---
More information about the scm-commits
mailing list