summaryrefslogtreecommitdiffstats
path: root/redhat/tdebase/kdebase-3.5.13.2-add_ck_shutdown.patch
blob: b862f00ca5b62c98a14b2f4c218000f95878729d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- trinity-tdebase-3.5.13.2/kdmlib/dmctl.cpp.ORI	2013-02-15 22:22:05.217381830 +0100
+++ trinity-tdebase-3.5.13.2/kdmlib/dmctl.cpp	2013-02-15 22:52:06.635823349 +0100
@@ -180,7 +180,12 @@
 	if (DMType == GDM)
 		return exec( "QUERY_LOGOUT_ACTION\n", re ) && re.find("HALT") >= 0;
 
+#ifdef WITH_CONSOLE_KIT
+	// Use consolekit to check if we can shutdown the computer
+	return exec( "dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.CanStop\n", re ) && re.find("boolean true") >= 0;
+#else
	return exec( "caps\n", re ) && re.find( "\tshutdown" ) >= 0;
+#endif
 }
 
 void