aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-02-06 10:17:14 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-02-06 10:17:14 +0800
commit749c7626eb82cd791b8278b00f8b5b350d74114b (patch)
tree92fea709fd01c8ca5188bf70fa7db5f99ffca737 /widgets
parent5580721e827e10cdf3f9a8319d58246811a84836 (diff)
downloadgsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.tar
gsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.tar.gz
gsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.tar.bz2
gsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.tar.lz
gsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.tar.xz
gsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.tar.zst
gsoc2013-evolution-749c7626eb82cd791b8278b00f8b5b350d74114b.zip
use the parent path to find the parent node rather than the row, which is
2003-02-06 Not Zed <NotZed@Ximian.com> * e-tree-table-adapter.c (delete_node): use the parent path to find the parent node rather than the row, which is not valid for the root node, which still needs its visible child count updated. svn path=/trunk/; revision=19797
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-tree-table-adapter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 16411c19ec..60e228406c 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -269,6 +269,7 @@ delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path)
int parent_row = get_row(etta, parent);
int row = get_row(etta, path);
GNode *gnode = lookup_gnode(etta, path);
+ GNode *parent_gnode = lookup_gnode(etta, parent);
e_table_model_pre_change(E_TABLE_MODEL(etta));
@@ -283,10 +284,10 @@ delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path)
move_map_elements(etta, row, row + to_remove, etta->priv->n_map - row - to_remove);
resize_map(etta, etta->priv->n_map - to_remove);
- if (parent_row != -1) {
- node_t *parent_node = etta->priv->map_table[parent_row];
- GNode *parent_gnode = lookup_gnode(etta, parent);
+ if (parent_gnode != NULL) {
+ node_t *parent_node = parent_gnode->data;
gboolean expandable = e_tree_model_node_is_expandable(etta->priv->source, parent);
+
update_child_counts(parent_gnode, - to_remove);
if (parent_node->expandable != expandable) {
e_table_model_pre_change(E_TABLE_MODEL(etta));