[Goodies-commits] r4717 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Sat May 3 08:03:45 CEST 2008


Author: squisher
Date: 2008-05-03 06:03:45 +0000 (Sat, 03 May 2008)
New Revision: 4717

Modified:
   xfburn/trunk/xfburn/xfburn-hal-manager.c
Log:
Bugfix: corrected previous bugfix for hal, hal now correctly registered globally instead of not at all

Modified: xfburn/trunk/xfburn/xfburn-hal-manager.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-hal-manager.c	2008-05-03 05:40:40 UTC (rev 4716)
+++ xfburn/trunk/xfburn/xfburn-hal-manager.c	2008-05-03 06:03:45 UTC (rev 4717)
@@ -173,6 +173,7 @@
   hal_finalize (priv->hal_context);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
+  halman = NULL;
 }
 
 /*           */
@@ -223,14 +224,12 @@
 xfburn_hal_manager_new ()
 {
 
-  /*
-   * For this to work we should rather register a central halman in xfburn-main,
-   * but is the connect/disconnect to hal really expensive enough?
-  if (halman == NULL)
-    halman = XFBURN_HAL_MANAGER (g_object_new (XFBURN_TYPE_HAL_MANAGER, NULL));
+  /* register 'global' for halman, because the callback from libhal does not support
+   * user data, and otherwise we can't get the reference to emit the g_signal on */
+  if (G_UNLIKELY (halman != NULL))
+    g_warning ("Existing instance of hal-manager detected! This is a bug, please report this.");
+  halman = XFBURN_HAL_MANAGER (g_object_new (XFBURN_TYPE_HAL_MANAGER, NULL));
 
   return G_OBJECT (halman);
-  */
-  return g_object_new (XFBURN_TYPE_HAL_MANAGER, NULL);
 }
 #endif /* HAVE_HAL */




More information about the Goodies-commits mailing list