[Goodies-commits] r7865 - in xfce4-power-manager/trunk: . src

Ali Abdallah aliov at xfce.org
Thu Jul 30 08:45:53 CEST 2009


Author: aliov
Date: 2009-07-30 06:45:53 +0000 (Thu, 30 Jul 2009)
New Revision: 7865

Modified:
   xfce4-power-manager/trunk/ChangeLog
   xfce4-power-manager/trunk/NEWS
   xfce4-power-manager/trunk/src/xfpm-manager.c
   xfce4-power-manager/trunk/src/xfpm-supply.c
Log:
	* Fix a typo that prevents from getting the correct 
	critical configuration.
	* Emit a warning and exit normally if failed to register
	DBus names instead of exiting abnormally so the session
	will try to restart us.

Modified: xfce4-power-manager/trunk/ChangeLog
===================================================================
--- xfce4-power-manager/trunk/ChangeLog	2009-07-29 15:57:37 UTC (rev 7864)
+++ xfce4-power-manager/trunk/ChangeLog	2009-07-30 06:45:53 UTC (rev 7865)
@@ -1,3 +1,10 @@
+2009-07-30: Ali aliov at xfce.org
+	* Fix a typo that prevents from getting the correct 
+	critical configuration.
+	* Emit a warning and exit normally if failed to register
+	DBus names instead of exiting abnormally so the session
+	will try to restart us.
+
 2009-07-27: Ali aliov at xfce.org
 	* src/xfpm-battery.c don't notify when starting up.
 	* src/xfpm-engine.c fix a typo output message.

Modified: xfce4-power-manager/trunk/NEWS
===================================================================
--- xfce4-power-manager/trunk/NEWS	2009-07-29 15:57:37 UTC (rev 7864)
+++ xfce4-power-manager/trunk/NEWS	2009-07-30 06:45:53 UTC (rev 7865)
@@ -2,3 +2,4 @@
 =======
 - Make it possible to compile without network manager support.
 - Add never show icon to the system tray configuration (bug #5613).
+- Fix a typo that prevents from getting the correct critical configuration (bug #5619).

Modified: xfce4-power-manager/trunk/src/xfpm-manager.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-manager.c	2009-07-29 15:57:37 UTC (rev 7864)
+++ xfce4-power-manager/trunk/src/xfpm-manager.c	2009-07-30 06:45:53 UTC (rev 7865)
@@ -181,20 +181,21 @@
     return TRUE;
 }
 
-static void
+static gboolean
 xfpm_manager_reserve_names (XfpmManager *manager)
 {
-    if ( !xfpm_dbus_register_name (dbus_g_connection_get_connection(manager->priv->session_bus),
-				  "org.xfce.PowerManager") ) 
-    {
-	g_error ("Unable to reserve bus name: Xfce Power Manager\n");
-    }
-    
-    if (!xfpm_dbus_register_name (dbus_g_connection_get_connection(manager->priv->session_bus),
+    if ( !xfpm_dbus_register_name (dbus_g_connection_get_connection (manager->priv->session_bus),
+				   "org.xfce.PowerManager") ||
+	 !xfpm_dbus_register_name (dbus_g_connection_get_connection (manager->priv->session_bus),
 				  "org.freedesktop.PowerManagement") )
     {
-	g_error ("Unable to reserve bus name: PowerManagement\n");
+	g_warning ("Unable to reserve bus name: Maybe any already running instance?\n");
+	xfpm_session_quit (manager->priv->session);
+	g_object_unref (G_OBJECT (manager));
+	gtk_main_quit ();
+	return FALSE;
     }
+    return TRUE;
 }
 
 XfpmManager *
@@ -215,8 +216,9 @@
 {
     gboolean hal_running;
     
-    xfpm_manager_reserve_names (manager);
-    
+    if ( !xfpm_manager_reserve_names (manager) )
+	goto out;
+	
     dbus_g_error_domain_register (XFPM_ERROR,
 				  NULL,
 				  XFPM_TYPE_ERROR);

Modified: xfce4-power-manager/trunk/src/xfpm-supply.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-supply.c	2009-07-29 15:57:37 UTC (rev 7864)
+++ xfce4-power-manager/trunk/src/xfpm-supply.c	2009-07-30 06:45:53 UTC (rev 7865)
@@ -392,7 +392,7 @@
 {
     XfpmShutdownRequest critical_action;
     
-    g_object_get (G_OBJECT (supply),
+    g_object_get (G_OBJECT (supply->priv->conf),
 	          CRITICAL_BATT_ACTION_CFG, &critical_action,
 		  NULL);
 




More information about the Goodies-commits mailing list