gnome-system-tools r4186 - trunk/src/common



Author: carlosg
Date: Tue Feb 26 09:42:35 2008
New Revision: 4186
URL: http://svn.gnome.org/viewvc/gnome-system-tools?rev=4186&view=rev

Log:
2008-02-26  Carlos Garnacho  <carlosg gnome org>

        * gst-polkit-action.c (gst_polkit_action_init): Do not spew extra
        critical warnings if any of the DBusConnections can't be created.
        Fixes what can be fixed in #518796.


Modified:
   trunk/src/common/ChangeLog
   trunk/src/common/gst-polkit-action.c

Modified: trunk/src/common/gst-polkit-action.c
==============================================================================
--- trunk/src/common/gst-polkit-action.c	(original)
+++ trunk/src/common/gst-polkit-action.c	Tue Feb 26 09:42:35 2008
@@ -161,7 +161,6 @@
 	dbus_error_init (&error);
 	priv->pk_context = polkit_context_new ();
 	priv->system_bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
-	dbus_connection_set_exit_on_disconnect (priv->system_bus, FALSE);
 
 	priv->main_loop = g_main_loop_new (NULL, FALSE);
 
@@ -171,18 +170,20 @@
 	if (dbus_error_is_set (&error)) {
 		g_critical ("Cannot create system bus: %s", error.message);
 		dbus_error_free (&error);
+	} else {
+		dbus_connection_set_exit_on_disconnect (priv->system_bus, FALSE);
 	}
 
 	priv->session_bus = dbus_bus_get (DBUS_BUS_SESSION, &error);
-	dbus_connection_set_exit_on_disconnect (priv->session_bus, FALSE);
 
 	if (dbus_error_is_set (&error)) {
 		g_critical ("Cannot create session bus: %s", error.message);
 		dbus_error_free (&error);
+	} else {
+		dbus_connection_set_exit_on_disconnect (priv->session_bus, FALSE);
+		dbus_connection_setup_with_g_main (priv->session_bus, NULL);
 	}
 
-	dbus_connection_setup_with_g_main (priv->session_bus, NULL);
-
 	/* FIXME: listen when polkit configuration changes */
 
 	if (!polkit_context_init (priv->pk_context, NULL)) {



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