diff options
author | Mike Kestner <mkestner@ximian.com> | 2003-02-21 03:15:14 +0800 |
---|---|---|
committer | Mike Kestner <mkestner@src.gnome.org> | 2003-02-21 03:15:14 +0800 |
commit | 4a0d26411c9591ac23f86d60b799b7422d99fca3 (patch) | |
tree | 7149c0bd6d670e950bb01652005a9d4da5f56f8e /widgets/table/e-tree-selection-model.c | |
parent | 12f146c032eb21c73f9a941ce812876a23e625f0 (diff) | |
download | gsoc2013-evolution-4a0d26411c9591ac23f86d60b799b7422d99fca3.tar.gz gsoc2013-evolution-4a0d26411c9591ac23f86d60b799b7422d99fca3.tar.zst gsoc2013-evolution-4a0d26411c9591ac23f86d60b799b7422d99fca3.zip |
kill (etsm_find_node_unless_equals): use new etta_orig_position
2003-02-20 Mike Kestner <mkestner@ximian.com>
* e-tree-selection-model.c (etsm_orig_position): kill
(etsm_find_node_unless_equals): use new etta_orig_position
(update_parents): use new etta_orig_position
(etsm_recurse_is_path_selected): use new etta_orig_position
* e-tree-table-adapter.c (e_tree_table_adapter_orig_position): new
(resort_node): populate orig_pos, fix sorting_map bound bug
(create_gnode): initialize orig_pos
(delete_node): call resort_node so orig_pos gets updated
(insert_node): always call resort_node let it decide whether to sort
svn path=/trunk/; revision=19975
Diffstat (limited to 'widgets/table/e-tree-selection-model.c')
-rw-r--r-- | widgets/table/e-tree-selection-model.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index a790498c61..17c596062a 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -180,23 +180,6 @@ etsm_real_clear (ETreeSelectionModel *etsm) } -static gint -etsm_orig_position(ETreeModel *etm, ETreePath path) -{ - ETreePath parent, p; - gint pos; - - parent = e_tree_model_node_get_parent(etm, path); - for (pos = 0, p = e_tree_model_node_get_first_child(etm, parent); - p && (p != path); - p = e_tree_model_node_get_next(etm, p), pos++); - - if (p) - return pos; - - return -1; -} - static ETreeSelectionModelNode * etsm_find_node_unless_equals (ETreeSelectionModel *etsm, ETreePath path, @@ -210,7 +193,7 @@ etsm_find_node_unless_equals (ETreeSelectionModel *etsm, if (parent) { selection_node = etsm_find_node_unless_equals(etsm, parent, grow); if (selection_node) { - int position = etsm_orig_position(etsm->priv->model, path); + int position = e_tree_table_adapter_orig_position(etsm->priv->etta, path); if (selection_node->all_children_selected && grow) return NULL; if (!(selection_node->any_children_selected || grow)) @@ -260,7 +243,7 @@ update_parents (ETreeSelectionModel *etsm, ETreePath path) g_free(node_sequence); return; } - orig_position_sequence[i] = etsm_orig_position(etsm->priv->model, parents); + orig_position_sequence[i] = e_tree_table_adapter_orig_position(etsm->priv->etta, parents); parents = e_tree_model_node_get_parent(etsm->priv->model, parents); } @@ -622,7 +605,7 @@ etsm_recurse_is_path_selected (ETreeSelectionModel *etsm, if (parent) { selection_node = etsm_recurse_is_path_selected (etsm, parent, is_selected); if (selection_node) { - int position = etsm_orig_position(etsm->priv->model, path); + int position = e_tree_table_adapter_orig_position(etsm->priv->etta, path); if (position < 0 || position >= selection_node->num_children) { *is_selected = FALSE; return NULL; |