diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-tree.c | 36 | ||||
-rw-r--r-- | widgets/table/e-tree.h | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 51d807eed4..e92254ce10 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1658,6 +1658,42 @@ e_tree_selected_path_foreach (ETree *e_tree, callback, closure); } + +/* Standard functions */ +static void +et_foreach_recurse (ETreeModel *model, + ETreePath path, + ETreeForeachFunc callback, + gpointer closure) +{ + ETreePath child; + + callback(path, closure); + + child = e_tree_model_node_get_first_child(E_TREE_MODEL(model), path); + for ( ; child; child = e_tree_model_node_get_next(E_TREE_MODEL(model), child)) + if (child) + et_foreach_recurse (model, child, callback, closure); +} + +void +e_tree_path_foreach (ETree *e_tree, + ETreeForeachFunc callback, + gpointer closure) +{ + ETreePath root; + + g_return_if_fail(e_tree != NULL); + g_return_if_fail(E_IS_TREE(e_tree)); + + root = e_tree_model_get_root (e_tree->priv->model); + + if (root) + et_foreach_recurse (e_tree->priv->model, + root, + callback, + closure); +} #endif EPrintable * diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 68b60f8c25..2b74f3b8b0 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -184,6 +184,9 @@ void e_tree_selected_row_foreach (ETree *e_tree, void e_tree_selected_path_foreach (ETree *e_tree, ETreeForeachFunc callback, gpointer closure); +void e_tree_path_foreach (ETree *e_tree, + ETreeForeachFunc callback, + gpointer closure); #endif gint e_tree_selected_count (ETree *e_tree); EPrintable *e_tree_get_printable (ETree *e_tree); |