diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-06-19 22:48:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-06-20 02:15:25 +0800 |
commit | a100a1588a2a880da482f4bbc15aa02d7abab312 (patch) | |
tree | 0704558ac3be2608da7f5facdd80ccd5a4688fa7 /mail | |
parent | 3ecab2f66278d486698e06d316a53f2f51670c49 (diff) | |
download | gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.tar gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.tar.gz gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.tar.bz2 gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.tar.lz gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.tar.xz gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.tar.zst gsoc2013-evolution-a100a1588a2a880da482f4bbc15aa02d7abab312.zip |
Add e_tree_model_node_get_n_nodes().
Returns the total number of nodes in the tree model, including hidden
nodes in collapsed tree branches.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/message-list.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index ada7f11871..d6a22485ea 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2704,6 +2704,23 @@ message_list_is_expandable (ETreeModel *tree_model, } static guint +message_list_get_n_nodes (ETreeModel *tree_model) +{ + ETreePath root; + guint n_nodes = 0; + + root = e_tree_model_get_root (tree_model); + + if (root == NULL) + return 0; + + /* The root node is an empty placeholder, so + * subtract one from the count to exclude it. */ + + return g_node_n_nodes ((GNode *) root, G_TRAVERSE_ALL) - 1; +} + +static guint message_list_get_n_children (ETreeModel *tree_model, ETreePath path) { @@ -3154,6 +3171,7 @@ message_list_tree_model_init (ETreeModelInterface *interface) interface->get_next = message_list_get_next; interface->is_root = message_list_is_root; interface->is_expandable = message_list_is_expandable; + interface->get_n_nodes = message_list_get_n_nodes; interface->get_n_children = message_list_get_n_children; interface->depth = message_list_depth; interface->get_expanded_default = message_list_get_expanded_default; |