From 4da3e76c2cb4e89850166ae5fa0bf2e4db837733 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 12 Jul 2001 20:44:02 +0000 Subject: Ignore set_expanded if the node is the root and root_visible is FALSE. 2001-07-12 Christopher James Lahey * e-tree-table-adapter.c (e_tree_table_adapter_node_set_expanded): Ignore set_expanded if the node is the root and root_visible is FALSE. * e-tree.c (item_key_press): Don't call set_expanded on NULL paths. svn path=/trunk/; revision=11061 --- widgets/table/e-tree-table-adapter.c | 3 +++ widgets/table/e-tree.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index f02494c4e1..99c312c805 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -928,6 +928,9 @@ void e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ET ETreeTableAdapterNode *node; int row; + if (e_tree_model_node_is_root (etta->priv->source, path) && !etta->priv->root_visible) + return; + node = find_or_create_node(etta, path); row = find_row_num(etta, path); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 4af1cc2dab..1c45afa7ef 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -555,14 +555,20 @@ item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) break; case '=': case GDK_Right: - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); - e_tree_table_adapter_node_set_expanded (et->priv->etta, path, TRUE); + if (row != -1) { + path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + if (path) + e_tree_table_adapter_node_set_expanded (et->priv->etta, path, TRUE); + } return_val = 1; break; case '-': case GDK_Left: - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); - e_tree_table_adapter_node_set_expanded (et->priv->etta, path, FALSE); + if (row != -1) { + path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + if (path) + e_tree_table_adapter_node_set_expanded (et->priv->etta, path, FALSE); + } return_val = 1; break; default: -- cgit