[evolution-patches] 42856: Crash on tree node update



This patch refines the code that restores the expanded state onto a node
that is being updated.  It ensures the state list is parent nodes before
children, and then only expands a node from the state list if it is
still in the tree.  

The trace in the crash is suspect and I can't reproduce, so this is my
best stab at a solution.

Mike
Index: gal/e-table/ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/ChangeLog,v
retrieving revision 1.898
diff -u -p -r1.898 ChangeLog
--- gal/e-table/ChangeLog	15 May 2003 20:58:15 -0000	1.898
+++ gal/e-table/ChangeLog	15 May 2003 21:24:06 -0000
@@ -1,3 +1,11 @@
+2003-05-15  Mike Kestner  <mkestner ximian com>
+
+	* e-table-item.c (eti_event): fix a couple timer checks
+	* e-tree-table-adapter.c (update_node): Traverse POST order
+	so that the parent nodes are at the head of the prepended list.
+	Don't restore expanded state to nodes that aren't in the tree
+	any longer.  Hopefully fixes #42856.
+
 2003-05-15  Ettore Perazzoli  <ettore ximian com>
 
 	* e-tree.c (tree_canvas_size_allocate): Call
Index: gal/e-table/e-table-item.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-table-item.c,v
retrieving revision 1.222
diff -u -p -r1.222 e-table-item.c
--- gal/e-table/e-table-item.c	14 May 2003 17:56:50 -0000	1.222
+++ gal/e-table/e-table-item.c	15 May 2003 21:24:08 -0000
@@ -2545,7 +2545,7 @@ eti_event (GnomeCanvasItem *item, GdkEve
 
 #ifdef DO_TOOLTIPS
 		if (!g_getenv ("GAL_DONT_DO_TOOLTIPS")) {
-			if (eti->tooltip->timer > 0)
+			if (eti->tooltip->timer)
 				gtk_timeout_remove (eti->tooltip->timer);
 			eti->tooltip->col = col;
 			eti->tooltip->row = row;
@@ -2779,7 +2779,7 @@ eti_event (GnomeCanvasItem *item, GdkEve
 		d(leave = TRUE);
 	case GDK_ENTER_NOTIFY:
 		d(g_print("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY"));
-		if (eti->tooltip->timer > 0)
+		if (eti->tooltip->timer)
 			gtk_timeout_remove (eti->tooltip->timer);
 		eti->tooltip->timer = 0;
 		break;
Index: gal/e-table/e-tree-table-adapter.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-tree-table-adapter.c,v
retrieving revision 1.54
diff -u -p -r1.54 e-tree-table-adapter.c
--- gal/e-table/e-tree-table-adapter.c	6 May 2003 18:19:15 -0000	1.54
+++ gal/e-table/e-tree-table-adapter.c	15 May 2003 21:24:08 -0000
@@ -474,7 +474,7 @@ update_node(ETreeTableAdapter *etta, ETr
 	closure.paths = NULL;
 
 	if (gnode)
-		g_node_traverse(gnode, G_IN_ORDER, G_TRAVERSE_ALL, -1, check_expanded, &closure);
+		g_node_traverse(gnode, G_POST_ORDER, G_TRAVERSE_ALL, -1, check_expanded, &closure);
 
 	if (e_tree_model_node_is_root(etta->priv->source, path))
 		generate_tree(etta, path);
@@ -484,7 +484,8 @@ update_node(ETreeTableAdapter *etta, ETr
 	}
 
 	for (l = closure.paths; l; l = l->next)
-		e_tree_table_adapter_node_set_expanded (etta, l->data, !closure.expanded);
+		if (lookup_gnode(etta, l->data))
+			e_tree_table_adapter_node_set_expanded (etta, l->data, !closure.expanded);
 
 	g_slist_free(closure.paths);
 }


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