aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-03-31 23:08:36 +0800
committerChris Lahey <clahey@src.gnome.org>2001-03-31 23:08:36 +0800
commit153eecb0b2829a3379eecca2c0db25a9549f98a5 (patch)
treef4bd09d121bff4957e054895f59b534f1fd42bfd
parent60d3d3a0a3d9b63b41d905db615b3cc2a0ca8efb (diff)
downloadgsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.tar
gsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.tar.gz
gsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.tar.bz2
gsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.tar.lz
gsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.tar.xz
gsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.tar.zst
gsoc2013-evolution-153eecb0b2829a3379eecca2c0db25a9549f98a5.zip
Made e_tree_selection_model_foreach work. (etsm_select_all): Made
2001-03-31 Christopher James Lahey <clahey@ximian.com> * e-tree-selection-model.c (etsm_foreach_all_recurse): Made e_tree_selection_model_foreach work. (etsm_select_all): Made etsm_select_all work. (update_parents): Fixed a crash. svn path=/trunk/; revision=9073
-rw-r--r--widgets/table/e-tree-selection-model.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
index 93f59583d8..ac34653362 100644
--- a/widgets/table/e-tree-selection-model.c
+++ b/widgets/table/e-tree-selection-model.c
@@ -373,6 +373,12 @@ etsm_select_all (ESelectionModel *selection)
etsm->root->all_children_selected = TRUE;
etsm->root->any_children_selected = TRUE;
+ e_tree_selection_model_node_fill_children(etsm, e_tree_model_get_root(E_TREE_MODEL(etsm->ets)), etsm->root);
+ etsm->root->all_children_selected_array = e_bit_array_new(etsm->root->num_children);
+ etsm->root->any_children_selected_array = e_bit_array_new(etsm->root->num_children);
+ e_bit_array_select_all(etsm->root->all_children_selected_array);
+ e_bit_array_select_all(etsm->root->any_children_selected_array);
+
if (etsm->cursor_col == -1)
etsm->cursor_col = 0;
if (etsm->cursor_path == NULL)
@@ -526,7 +532,7 @@ update_parents (ETreeSelectionModel *etsm, ETreePath path)
depth = e_tree_model_node_depth (E_TREE_MODEL(ets), path);
- orig_position_sequence = g_new(int, depth);
+ orig_position_sequence = g_new(int, depth + 1);
node_sequence = g_new(ETreeSelectionModelNode *, depth + 1);
parents = path;
@@ -746,15 +752,16 @@ etsm_foreach_all_recurse (ETreeSelectionModel *etsm,
ETreeForeachFunc callback,
gpointer closure)
{
- ETreePath child = e_tree_model_node_get_first_child(E_TREE_MODEL(etsm->ets), path);
- for ( ; child; child = e_tree_model_node_get_next(E_TREE_MODEL(etsm->ets), child)) {
- if (child) {
- ETreePath model_path = e_tree_sorted_view_to_model_path(etsm->ets, child);
- callback(model_path, closure);
+ ETreePath model_path;
+ ETreePath child;
+
+ model_path = e_tree_sorted_view_to_model_path(etsm->ets, path);
+ callback(model_path, closure);
+ child = e_tree_model_node_get_first_child(E_TREE_MODEL(etsm->ets), path);
+ for ( ; child; child = e_tree_model_node_get_next(E_TREE_MODEL(etsm->ets), child))
+ if (child)
etsm_foreach_all_recurse (etsm, child, callback, closure);
- }
- }
}
static void