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



commit 23b54570033436349238cdd8cbc0f97dd48ffe12
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 108f2f8..1945f50 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-10-12  Marco Diego Aurélio Mesquita <marcodiegomesquita gmail com>
 
 	Implemented preview feature for Glade.
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 317bb20..91aa43a 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -4635,11 +4635,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]