aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-03-15 07:38:34 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-03-15 07:38:34 +0800
commitcb382f6c30493da937bbc2e1b42aa6044cba5d74 (patch)
treef95850faa39845e7ba64f319fec864ba0f9a9747 /widgets/table
parent35ff6769cb500b826678ae64504befc1c9c4757e (diff)
downloadgsoc2013-evolution-cb382f6c30493da937bbc2e1b42aa6044cba5d74.tar.gz
gsoc2013-evolution-cb382f6c30493da937bbc2e1b42aa6044cba5d74.tar.zst
gsoc2013-evolution-cb382f6c30493da937bbc2e1b42aa6044cba5d74.zip
save and restore expanded state so parents don't collapse when children
2003-03-14 Mike Kestner <mkestner@ximian.com> * e-tree-table-adapter.c (update_node): save and restore expanded state so parents don't collapse when children are added to them. (e_tree_table_adapter_node_is_expanded): guard against null nodes. svn path=/trunk/; revision=20303
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-tree-table-adapter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 6e9894898e..83bbd0b57f 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -446,11 +446,15 @@ static void
update_node(ETreeTableAdapter *etta, ETreePath path)
{
ETreePath parent = e_tree_model_node_get_parent(etta->priv->source, path);
+ gboolean expanded = e_tree_table_adapter_node_is_expanded (etta, path);
delete_node(etta, parent, path);
if (e_tree_model_node_is_root(etta->priv->source, path))
generate_tree(etta, path);
else
insert_node(etta, parent, path);
+
+ if (expanded != e_tree_model_get_expanded_default (etta->priv->source))
+ e_tree_table_adapter_node_set_expanded (etta, path, expanded);
}
static void
@@ -1082,10 +1086,11 @@ e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path)
gboolean
e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path)
{
- if (!e_tree_model_node_is_expandable (etta->priv->source, path))
+ node_t *node = get_node(etta, path);
+ if (!e_tree_model_node_is_expandable (etta->priv->source, path) || !node)
return FALSE;
- return get_node(etta, path)->expanded;
+ return node->expanded;
}
void