[maemo-commits] [maemo-commits] r11357 - in projects/haf/trunk/hildon-1: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Apr 27 17:47:23 EEST 2007
Author: xan
Date: 2007-04-27 17:47:22 +0300 (Fri, 27 Apr 2007)
New Revision: 11357

Modified:
   projects/haf/trunk/hildon-1/ChangeLog
   projects/haf/trunk/hildon-1/src/hildon-bread-crumb-trail.c
Log:
	* src/hildon-bread-crumb-trail.c: make the add method handle all the
	internal details of adding a bread crumb to the trail.


Modified: projects/haf/trunk/hildon-1/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-1/ChangeLog	2007-04-27 14:26:30 UTC (rev 11356)
+++ projects/haf/trunk/hildon-1/ChangeLog	2007-04-27 14:47:22 UTC (rev 11357)
@@ -1,3 +1,8 @@
+2007-04-27  Xan Lopez  <xan.lopez at nokia.com>
+
+	* src/hildon-bread-crumb-trail.c: make the add method handle all the
+	internal details of adding a bread crumb to the trail.
+
 2007-04-26  Michael Dominic Kostrzewa  <michael.kostrzewa at nokia.com> 
 
 	[1.0.4-1 release]

Modified: projects/haf/trunk/hildon-1/src/hildon-bread-crumb-trail.c
===================================================================
--- projects/haf/trunk/hildon-1/src/hildon-bread-crumb-trail.c	2007-04-27 14:26:30 UTC (rev 11356)
+++ projects/haf/trunk/hildon-1/src/hildon-bread-crumb-trail.c	2007-04-27 14:47:22 UTC (rev 11357)
@@ -374,6 +374,18 @@
                               GtkWidget *widget)
 {
   gtk_widget_set_parent (widget, GTK_WIDGET (container));
+
+  if (HILDON_IS_BREAD_CRUMB (widget))
+    {
+      HildonBreadCrumbTrail *bct = HILDON_BREAD_CRUMB_TRAIL (container);
+
+      g_signal_connect (G_OBJECT (widget), "crumb-activated",
+                        G_CALLBACK (crumb_activated_cb), container);
+
+      bct->priv->item_list = g_list_prepend (bct->priv->item_list, widget);
+
+      hildon_bread_crumb_trail_update_back_button_sensitivity (bct);
+    }
 }
 
 static void
@@ -517,12 +529,6 @@
                  get_bread_crumb_id (item));
 }
 
-/*
- * Helper function to add a bread crumb to the trail. This should go in the
- * container add method, but there's no way to plug there the id/destroy
- * information (FIXME)
- */
-
 static void
 attach_bread_crumb (HildonBreadCrumbTrail *bct,
                     GtkWidget *bread_crumb,
@@ -531,15 +537,9 @@
 {
   g_object_set_data_full (G_OBJECT (bread_crumb), "bread-crumb-id", id, destroy);
 
-  g_signal_connect (G_OBJECT (bread_crumb), "crumb-activated",
-                    G_CALLBACK (crumb_activated_cb), bct);
+  gtk_container_add (GTK_CONTAINER (bct), bread_crumb);
 
-  bct->priv->item_list = g_list_prepend (bct->priv->item_list, bread_crumb);
-
-  gtk_container_add (GTK_CONTAINER (bct), bread_crumb);
   gtk_widget_show (bread_crumb);
-
-  hildon_bread_crumb_trail_update_back_button_sensitivity (bct);
 }
 
 /* PUBLIC API */


More information about the maemo-commits mailing list