aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {