[glade3/offscreen-gtk3] project-model: Don't be picky about non-existing children



commit 2dd219bd8fa453f1f53493c4e1ebfa08b0d2a1c8
Author: Johannes Schmid <jhs gnome org>
Date:   Wed Nov 10 19:44:23 2010 +0100

    project-model: Don't be picky about non-existing children
    
    It is sometimes possible that children are added before their parents in the tree. We simply
    ignore that for now as it doesn't cause any harm in the tree model.

 ChangeLog               |    8 ++++++++
 gladeui/glade-project.c |   12 +++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 62c7507..583d43d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-12  Johannes Schmid <jhs gnome org>
+
+	* gladeui/glade-project.c:
+	project-model: Don't be picky about non-existing children
+	It is sometimes possible that children are added before their parents
+	in the tree. We simply ignore that for now as it doesn't 
+	cause any harm in the tree model.
+
 2010-11-05  Matthias Clasen <mclasen redhat com>
 
 	* gladeui/glade-command.c:
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index d5983a1..4255c5d 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -4633,11 +4633,13 @@ glade_project_model_get_path (GtkTreeModel* model,
 	{
 		GList* children = glade_widget_get_children (parent);
 		GList* child = g_list_find (children, glade_widget_get_object (widget));
-		
-		g_assert (child != NULL);
-		
-		gtk_tree_path_prepend_index (path,
-		                             g_list_position (children, child));
+
+		if (!child)
+			gtk_tree_path_prepend_index (path,
+			                             0);
+		else
+			gtk_tree_path_prepend_index (path,
+			                             g_list_position (children, child));
 		
 		g_list_free (children);
 		widget = parent;



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