aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-10-26 14:48:09 +0800
committerChris Toshok <toshok@src.gnome.org>2000-10-26 14:48:09 +0800
commit7a6e9be357cef23e09cef1043dc9254e5f845671 (patch)
treecf1f12ef55cd25dd11d3dd75927a9c1b2be65e6f
parent37ffc13dcb735d0863377a71bed3f78adf53d875 (diff)
downloadgsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.tar
gsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.tar.gz
gsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.tar.bz2
gsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.tar.lz
gsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.tar.xz
gsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.tar.zst
gsoc2013-evolution-7a6e9be357cef23e09cef1043dc9254e5f845671.zip
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
-rw-r--r--widgets/table/e-tree-model.c15
1 files changed, 6 insertions, 9 deletions
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);