diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-05-25 07:47:33 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-05-25 07:47:33 +0800 |
commit | e6298a6cd5faa861d4185c1399fe627e6d70d8f8 (patch) | |
tree | 1566fc4d70540789a617a65b306ed4739f7dfa73 /widgets/table | |
parent | 69c1a820e1c94363247839a4a1fb8b47bcd2821a (diff) | |
download | gsoc2013-evolution-e6298a6cd5faa861d4185c1399fe627e6d70d8f8.tar.gz gsoc2013-evolution-e6298a6cd5faa861d4185c1399fe627e6d70d8f8.tar.zst gsoc2013-evolution-e6298a6cd5faa861d4185c1399fe627e6d70d8f8.zip |
Added would_be_expanded refactoring code out of is_expanded.
2002-05-24 Christopher James Lahey <clahey@ximian.com>
* e-tree-table-adapter.c
(e_tree_table_adapter_node_would_be_expanded,
e_tree_table_adapter_node_is_expanded): Added would_be_expanded
refactoring code out of is_expanded.
(find_first_child_node_maybe_deleted): Use the new function.
svn path=/trunk/; revision=17016
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-tree-table-adapter.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index c7a6c991c8..a710c51f65 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -123,6 +123,26 @@ find_or_create_node(ETreeTableAdapter *etta, ETreePath path) return node; } +static gboolean +e_tree_table_adapter_node_would_be_expanded (ETreeTableAdapter *etta, ETreePath path) +{ + ETreeTableAdapterNode *node; + + if (e_tree_model_node_is_root(etta->priv->source, path) && + !etta->priv->root_visible) + return TRUE; + + node = find_node (etta, path); + if (node) + return node->expanded; + else { + if (e_tree_model_node_is_root(etta->priv->source, path)) + return TRUE; + else + return e_tree_model_get_expanded_default(etta->priv->source); + } +} + static void add_expanded_node(ETreeTableAdapter *etta, char *save_id, gboolean expanded) { @@ -188,7 +208,7 @@ find_first_child_node_maybe_deleted(ETreeTableAdapter *adapter, int row) { if (row != -1) { ETreePath path = adapter->priv->map_table[row]; - if (e_tree_table_adapter_node_is_expanded (adapter, path)) { + if (e_tree_table_adapter_node_would_be_expanded (adapter, path)) { row ++; if (row >= adapter->priv->n_map) return -1; @@ -1140,22 +1160,8 @@ void e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath gboolean e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) { - ETreeTableAdapterNode *node; - if (!e_tree_model_node_is_expandable (etta->priv->source, path)) return FALSE; - if (e_tree_model_node_is_root(etta->priv->source, path) && - !etta->priv->root_visible) - return TRUE; - - node = find_node (etta, path); - if (node) - return node->expanded; - else { - if (e_tree_model_node_is_root(etta->priv->source, path)) - return TRUE; - else - return e_tree_model_get_expanded_default(etta->priv->source); - } + return e_tree_table_adapter_node_would_be_expanded (etta, path); } |