remove the save_id here, so we don't save state for nodes that no longer
2000-10-25 Chris Toshok <toshok@helixcode.com> * 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
This commit is contained in:
committed by
Chris Toshok
parent
37ffc13dcb
commit
7a6e9be357
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user