gnome-session r4824 - in branches/dbus_based: . gnome-session



Author: mccann
Date: Tue Jul 22 04:26:21 2008
New Revision: 4824
URL: http://svn.gnome.org/viewvc/gnome-session?rev=4824&view=rev

Log:
2008-07-22  William Jon McCann  <jmccann redhat com>

	* gnome-session/gsm-consolekit.c (gsm_consolekit_init),
	(gsm_consolekit_can_restart), (gsm_consolekit_can_stop):
	* gnome-session/gsm-logout-dialog.c:
	Add some more verbosity when not compiled with PK-gnome.



Modified:
   branches/dbus_based/ChangeLog
   branches/dbus_based/gnome-session/gsm-consolekit.c
   branches/dbus_based/gnome-session/gsm-logout-dialog.c

Modified: branches/dbus_based/gnome-session/gsm-consolekit.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-consolekit.c	(original)
+++ branches/dbus_based/gnome-session/gsm-consolekit.c	Tue Jul 22 04:26:21 2008
@@ -18,9 +18,7 @@
  * 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <errno.h>
 #include <string.h>
@@ -259,7 +257,7 @@
         error = NULL;
 
         if (!gsm_consolekit_ensure_ck_connection (manager, &error)) {
-                g_message ("Could not connect to ConsoleKit: %s",
+                g_warning ("Could not connect to ConsoleKit: %s",
                            error->message);
                 g_error_free (error);
         }
@@ -831,8 +829,18 @@
 gsm_consolekit_can_restart (GsmConsolekit *manager)
 {
 #ifdef HAVE_POLKIT_GNOME
-        return gsm_consolekit_ensure_ck_connection (manager, NULL);
+        gboolean res;
+        GError  *error;
+        error = NULL;
+        res = gsm_consolekit_ensure_ck_connection (manager, &error);
+        if (!res) {
+                g_warning ("Could not connect to ConsoleKit: %s",
+                           error->message);
+                g_error_free (error);
+        }
+        return res;
 #else
+        g_debug ("GsmConsolekit: built without PolicyKit-gnome support - cannot restart system");
         return FALSE;
 #endif
 }
@@ -841,8 +849,18 @@
 gsm_consolekit_can_stop (GsmConsolekit *manager)
 {
 #ifdef HAVE_POLKIT_GNOME
-        return gsm_consolekit_ensure_ck_connection (manager, NULL);
+        gboolean res;
+        GError  *error;
+        error = NULL;
+        res = gsm_consolekit_ensure_ck_connection (manager, &error);
+        if (!res) {
+                g_warning ("Could not connect to ConsoleKit: %s",
+                           error->message);
+                g_error_free (error);
+        }
+        return res;
 #else
+        g_debug ("GsmConsolekit: built without PolicyKit-gnome support - cannot stop system");
         return FALSE;
 #endif
 }

Modified: branches/dbus_based/gnome-session/gsm-logout-dialog.c
==============================================================================
--- branches/dbus_based/gnome-session/gsm-logout-dialog.c	(original)
+++ branches/dbus_based/gnome-session/gsm-logout-dialog.c	Tue Jul 22 04:26:21 2008
@@ -22,9 +22,7 @@
  *	Vincent Untz <vuntz gnome org>
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]