aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-07 10:26:36 +0800
committerDan Winship <danw@src.gnome.org>2000-07-07 10:26:36 +0800
commit540bde0aff7cc2b29f90a29e974e09fd400ae7ba (patch)
tree6867e0e3364f93ede1a98ac2c8e33b91a17d1f12 /widgets
parent1c3ee9654bec525a0f650f20dfea92c3f79b6e4a (diff)
downloadgsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.tar
gsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.tar.gz
gsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.tar.bz2
gsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.tar.lz
gsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.tar.xz
gsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.tar.zst
gsoc2013-evolution-540bde0aff7cc2b29f90a29e974e09fd400ae7ba.zip
Make this work recursively.
* e-tree-model.c (e_tree_model_node_remove): Make this work recursively. svn path=/trunk/; revision=3935
Diffstat (limited to 'widgets')
-rw-r--r--widgets/e-table/ChangeLog5
-rw-r--r--widgets/e-table/e-tree-model.c9
-rw-r--r--widgets/table/e-tree-model.c9
3 files changed, 21 insertions, 2 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 69cf89d832..dd5432dbdc 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-06 Dan Winship <danw@helixcode.com>
+
+ * e-tree-model.c (e_tree_model_node_remove): Make this work
+ recursively.
+
2000-07-06 Chris Toshok <toshok@helixcode.com>
* e-cell-tree.c (ect_draw): fix the conditions under which we draw
diff --git a/widgets/e-table/e-tree-model.c b/widgets/e-table/e-tree-model.c
index 250ff4edb7..40e54a1667 100644
--- a/widgets/e-table/e-tree-model.c
+++ b/widgets/e-table/e-tree-model.c
@@ -634,6 +634,12 @@ e_tree_model_node_insert_before (ETreeModel *etree,
node_data);
}
+static void
+child_remove (GNode *node, gpointer etree)
+{
+ e_tree_model_node_remove (etree, node);
+}
+
gpointer
e_tree_model_node_remove (ETreeModel *etree, ETreePath *path)
{
@@ -641,7 +647,8 @@ e_tree_model_node_remove (ETreeModel *etree, ETreePath *path)
ENode *enode = (ENode*)path->data;
gpointer ret = enode->node_data;
- g_return_val_if_fail (!g_node_first_child(path), NULL);
+ /* remove children */
+ g_node_children_foreach (path, G_TRAVERSE_ALL, child_remove, etree);
/* clean up the display */
if (parent) {
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index 250ff4edb7..40e54a1667 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -634,6 +634,12 @@ e_tree_model_node_insert_before (ETreeModel *etree,
node_data);
}
+static void
+child_remove (GNode *node, gpointer etree)
+{
+ e_tree_model_node_remove (etree, node);
+}
+
gpointer
e_tree_model_node_remove (ETreeModel *etree, ETreePath *path)
{
@@ -641,7 +647,8 @@ e_tree_model_node_remove (ETreeModel *etree, ETreePath *path)
ENode *enode = (ENode*)path->data;
gpointer ret = enode->node_data;
- g_return_val_if_fail (!g_node_first_child(path), NULL);
+ /* remove children */
+ g_node_children_foreach (path, G_TRAVERSE_ALL, child_remove, etree);
/* clean up the display */
if (parent) {