[glade/glade-3-8] * gladeui/glade-project.c: Fix glade_project_notify_has_child() to notify that the children are go



commit 53e9b98cd979109a70a69d132ea9af3640328304
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Oct 9 17:58:16 2011 -0400

    	* gladeui/glade-project.c: Fix glade_project_notify_has_child() to notify
    	that the children are gone only when the last item on that level disappears.
    
    	Fixes bug 651673

 ChangeLog               |    7 +++++++
 gladeui/glade-project.c |   14 ++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b409f4f..2941312 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-09  Tristan Van Berkom <tvb gnome org>
+
+	* gladeui/glade-project.c: Fix glade_project_notify_has_child() to notify
+	that the children are gone only when the last item on that level disappears.
+
+	Fixes bug 651673
+
 2011-10-09  Fabien Parent <parent f gmail com>
 
 	* gladeui/glade-property.c, gladeui/glade-xml-utils.c:
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index e894664..4ac349a 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -2818,7 +2818,8 @@ glade_project_set_widget_name (GladeProject *project,
 
 static void
 glade_project_notify_row_has_child (GladeProject *project,
-				    GladeWidget  *gwidget)
+				    GladeWidget  *gwidget,
+				    gboolean      adding)
 {
 	GladeWidget *parent;
 	gint         siblings;
@@ -2829,7 +2830,7 @@ glade_project_notify_row_has_child (GladeProject *project,
 	{
 		siblings = glade_project_count_children (project, parent);
 
-		if (siblings == 1)
+		if (siblings == (adding ? 1 : 0))
 		{
 			GtkTreePath *path;
 			GtkTreeIter  iter;
@@ -2860,7 +2861,7 @@ glade_project_notify_row_inserted (GladeProject *project,
 	gtk_tree_model_row_inserted (GTK_TREE_MODEL (project), path, &iter);
 	gtk_tree_path_free (path);
 
-	glade_project_notify_row_has_child (project, gwidget);
+	glade_project_notify_row_has_child (project, gwidget, TRUE);
 }
 
 static void 
@@ -3113,7 +3114,7 @@ glade_project_remove_object (GladeProject *project, GObject *object)
 	gwidget->in_project = FALSE;
 
 
-	glade_project_notify_row_has_child (project, gwidget);
+	glade_project_notify_row_has_child (project, gwidget, FALSE);
 	g_object_unref (gwidget);
 
 }
@@ -4648,8 +4649,9 @@ glade_project_model_get_column_type (GtkTreeModel* model,
 }
 
 static gboolean
-glade_project_model_get_iter (GtkTreeModel * model,
-                              GtkTreeIter * iter, GtkTreePath * path)
+glade_project_model_get_iter (GtkTreeModel *model,
+                              GtkTreeIter  *iter, 
+			      GtkTreePath  *path)
 {
   GladeProject *project = GLADE_PROJECT (model);
   gint         *indices = gtk_tree_path_get_indices (path);



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