aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-memory.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-03-27 03:51:05 +0800
committerChris Lahey <clahey@src.gnome.org>2001-03-27 03:51:05 +0800
commit7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa (patch)
tree7f3d3b27b6974759d88792bbdb7e0696f5311627 /widgets/table/e-tree-memory.c
parentb86d822ec15050722006dacc84f535cb9dcf18b2 (diff)
downloadgsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.tar
gsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.tar.gz
gsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.tar.bz2
gsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.tar.lz
gsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.tar.xz
gsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.tar.zst
gsoc2013-evolution-7443055a53dcdbea2f9ac2867faa9bb0ca25e3aa.zip
Updated these to match the new e_tree_model_node_removed signal.
2001-03-26 Christopher James Lahey <clahey@ximian.com> * e-tree-memory.c, e-tree-table-adapter.c: Updated these to match the new e_tree_model_node_removed signal. * e-tree-model.c, e-tree-model.h: Added an old_position parameter to the node_removed signal so that it would be completely deterministic. * e-tree-sorted.c: Changed this so that paths keep track of their original position. This makes sorting much faster. svn path=/trunk/; revision=8953
Diffstat (limited to 'widgets/table/e-tree-memory.c')
-rw-r--r--widgets/table/e-tree-memory.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
index b14beafb15..886c7beb0f 100644
--- a/widgets/table/e-tree-memory.c
+++ b/widgets/table/e-tree-memory.c
@@ -524,12 +524,20 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node)
{
ETreeMemoryPath *path = node;
ETreeMemoryPath *parent = path->parent;
+ ETreeMemoryPath *sibling;
gpointer ret = path->node_data;
+ int old_position = 0;
g_return_val_if_fail(etree != NULL, NULL);
- if (!etree->priv->frozen)
+ if (!etree->priv->frozen) {
e_tree_model_pre_change(E_TREE_MODEL(etree));
+ for (old_position = 0, sibling = path;
+ sibling;
+ old_position++, sibling = sibling->prev_sibling)
+ /* Empty intentionally*/;
+ old_position --;
+ }
/* unlink this node - we only have to unlink the root node being removed,
since the others are only references from this node */
@@ -537,7 +545,7 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node)
/*printf("removing %d nodes from position %d\n", visible, base);*/
if (!etree->priv->frozen)
- e_tree_model_node_removed(E_TREE_MODEL(etree), parent, path);
+ e_tree_model_node_removed(E_TREE_MODEL(etree), parent, path, old_position);
child_free(etree, path);