From 7a6e9be357cef23e09cef1043dc9254e5f845671 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 26 Oct 2000 06:48:09 +0000 Subject: remove the save_id here, so we don't save state for nodes that no longer 2000-10-25 Chris Toshok * e-tree-model.c (e_tree_model_node_remove): remove the save_id here, so we don't save state for nodes that no longer exist. (etree_destroy): remove the foreach, since all the save_id's should have been removed by now (don't destroy a tree without destroying the root node.) also, make sure to call g_hash_table_destroy. svn path=/trunk/; revision=6202 --- widgets/table/e-tree-model.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'widgets/table/e-tree-model.c') diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 8afb1a011c..918c286b34 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -174,13 +174,6 @@ e_tree_model_node_traverse (ETreeModel *model, ETreePath *path, ETreePathFunc fu /* virtual methods */ -static gboolean -expanded_remove_func (gpointer key, gpointer value, gpointer user_data) -{ - g_free (key); - return TRUE; -} - static void etree_destroy (GtkObject *object) { @@ -189,8 +182,7 @@ etree_destroy (GtkObject *object) /* XXX lots of stuff to free here */ g_array_free (priv->row_array, TRUE); - g_hash_table_foreach_remove (priv->expanded_state, - expanded_remove_func, NULL); + g_hash_table_destroy (priv->expanded_state); g_string_free(priv->sort_group, TRUE); @@ -924,6 +916,9 @@ e_tree_model_node_insert (ETreeModel *tree_model, e_table_model_row_inserted (E_TABLE_MODEL(tree_model), parent_row + position + 1); } + + if (parent_path->compare) + e_tree_model_node_sort (tree_model, parent_path); } else { priv->root = new_path; @@ -1020,6 +1015,8 @@ e_tree_model_node_remove (ETreeModel *etree, ETreePath *path) e_tree_path_unlink (path); /* now free up the storage from that path */ + if (path->save_id) + g_hash_table_remove (priv->expanded_state, path->save_id); g_free (path->save_id); g_chunk_free (path, priv->node_chunk); -- cgit