summaryrefslogtreecommitdiff
path: root/gtk/gtktreemodel.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2002-03-12 04:48:50 +0000
committerJonathan Blandford <jrb@src.gnome.org>2002-03-12 04:48:50 +0000
commit5c02002e2cdf6fcccecb9ac0bab75e43fe65e814 (patch)
tree1f755cfb48011d90988c17d677d7979396660929 /gtk/gtktreemodel.c
parent7788a6a70264ae7c0dc16bdd0c8a0ddbde18258c (diff)
downloadgdk-pixbuf-5c02002e2cdf6fcccecb9ac0bab75e43fe65e814.tar.gz
fix totally broken foreach function.
Mon Mar 11 23:42:11 2002 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_foreach): fix totally broken foreach function.
Diffstat (limited to 'gtk/gtktreemodel.c')
-rw-r--r--gtk/gtktreemodel.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c
index cb3142236..94c763a20 100644
--- a/gtk/gtktreemodel.c
+++ b/gtk/gtktreemodel.c
@@ -1171,26 +1171,25 @@ gtk_tree_model_foreach_helper (GtkTreeModel *model,
GtkTreeModelForeachFunc func,
gpointer user_data)
{
- gtk_tree_path_append_index (path, 0);
-
do
{
GtkTreeIter child;
+ if ((* func) (model, path, iter, user_data))
+ return TRUE;
+
if (gtk_tree_model_iter_children (model, &child, iter))
{
+ gtk_tree_path_down (path);
if (gtk_tree_model_foreach_helper (model, &child, path, func, user_data))
return TRUE;
+ gtk_tree_path_up (path);
}
- if ((* func) (model, path, iter, user_data))
- return TRUE;
-
gtk_tree_path_next (path);
}
while (gtk_tree_model_iter_next (model, iter));
- gtk_tree_path_up (path);
return FALSE;
}