[maemo-commits] [maemo-commits] r9418 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jan 29 15:50:59 EET 2007
Author: jobi
Date: 2007-01-29 15:50:58 +0200 (Mon, 29 Jan 2007)
New Revision: 9418

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-legacy.c
Log:

2007-01-29  Johan Bilien  <johan.bilien at nokia.com>

	* src/hd-plugin-loader-legacy.c: Connect changes in the condition
	property to the set_conditional callback



Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-01-29 13:45:44 UTC (rev 9417)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-01-29 13:50:58 UTC (rev 9418)
@@ -1,3 +1,8 @@
+2007-01-29  Johan Bilien  <johan.bilien at nokia.com>
+
+	* src/hd-plugin-loader-legacy.c: Connect changes in the condition
+	property to the set_conditional callback
+
 2007-01-29  Moises Martinez  <moises.martinez at nokia.com>
 
 	* libhildondesktop/statusbar-item.[ch]:

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-legacy.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-legacy.c	2007-01-29 13:45:44 UTC (rev 9417)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-legacy.c	2007-01-29 13:50:58 UTC (rev 9418)
@@ -579,6 +579,28 @@
   return item;
 }
 
+typedef void (*SBSetConditional)  (void *data, gboolean cond);
+struct SBSetConditionalData
+{
+  SBSetConditional  cb;
+  gpointer          module_data;
+};
+      
+static void
+hd_plugin_loader_legacy_status_bar_set_conditional 
+                                (HildonDesktopItem           *item,
+                                 GParamSpec *arg1,
+                                 struct SBSetConditionalData *data)
+{
+  gboolean condition;
+  g_object_get (item,
+                "condition", &condition,
+                NULL);
+
+  data->cb (data->module_data, condition);
+}
+                
+
 static GtkWidget *
 hd_plugin_loader_legacy_status_bar_init (HDPluginLoaderLegacy *loader,
                                          GError **error)
@@ -592,7 +614,6 @@
                                      const gchar *str);
 
   typedef int  (*SBGetPriority)     (void *data);
-  typedef void (*SBSetConditional)  (void *data, gboolean cond);
 
   struct SBSymbols
     {
@@ -616,6 +637,8 @@
   gpointer          module_data;
   GtkWidget        *module_widget;
   GError           *local_error = NULL;
+  struct SBSetConditionalData
+                   *set_conditional_data;
   
   priv = HD_PLUGIN_LOADER_LEGACY_GET_PRIVATE (loader);
   
@@ -679,9 +702,13 @@
   g_signal_connect_swapped (item, "destroy",
                             G_CALLBACK (symbols.destroy),
                             module_data);
+  
+  /* FIXME: This is leaked */
+  set_conditional_data = g_new0 (struct SBSetConditionalData, 1);
+  g_signal_connect (item, "notify::condition",
+                    G_CALLBACK (hd_plugin_loader_legacy_status_bar_set_conditional),
+                    set_conditional_data);
 
-
-
   return item;
 
 }


More information about the maemo-commits mailing list