diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-10-03 05:13:43 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-10-03 05:13:43 +0800 |
commit | 9f50c83ac540a7a9624619b8ceb4da06b854057e (patch) | |
tree | 2063a5534c8cd439541b7c14db42a45f1c6eaf46 | |
parent | 46ffa49aa1a13d6cdd635d20daaefcec17a08d18 (diff) | |
download | gsoc2013-evolution-9f50c83ac540a7a9624619b8ceb4da06b854057e.tar.gz gsoc2013-evolution-9f50c83ac540a7a9624619b8ceb4da06b854057e.tar.zst gsoc2013-evolution-9f50c83ac540a7a9624619b8ceb4da06b854057e.zip |
don't screw things up if we sort a collapsed node.
2000-10-02 Chris Toshok <toshok@helixcode.com>
* e-tree-model.c (e_tree_model_node_sort): don't screw things up
if we sort a collapsed node.
svn path=/trunk/; revision=5673
-rw-r--r-- | widgets/table/e-tree-model.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index c3f727e825..2fa542ca9b 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -856,6 +856,7 @@ e_tree_model_node_sort (ETreeModel *tree_model, gboolean *expanded; int i; int child_index; + gboolean node_expanded = e_tree_model_node_is_expanded (tree_model, node); if (num_nodes == 0) return; @@ -869,7 +870,8 @@ e_tree_model_node_sort (ETreeModel *tree_model, path_array[i] = g_node_first_child(node); expanded[i] = e_tree_model_node_is_expanded (tree_model, path_array[i]); e_tree_model_node_set_expanded(tree_model, path_array[i], FALSE); - tree_model->row_array = g_array_remove_index (tree_model->row_array, child_index); + if (node_expanded) + tree_model->row_array = g_array_remove_index (tree_model->row_array, child_index); g_node_unlink (path_array[i]); } @@ -877,7 +879,8 @@ e_tree_model_node_sort (ETreeModel *tree_model, for (i = num_nodes - 1; i >= 0; i --) { g_node_prepend (node, path_array[i]); - tree_model->row_array = g_array_insert_val (tree_model->row_array, child_index, path_array[i]); + if (node_expanded) + tree_model->row_array = g_array_insert_val (tree_model->row_array, child_index, path_array[i]); e_tree_model_node_set_expanded (tree_model, path_array[i], expanded[i]); } |