diff options
author | Kristian Rietveld <kristian@planet.nl> | 2001-11-20 22:04:00 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2001-11-20 22:04:00 +0000 |
commit | e1634f474b67dbd4eb14ac18be53e2adf976e1d1 (patch) | |
tree | fc3b8757ca9498c7ddef2d641c8cbdbbc2aaa638 /gtk/gtktreemodel.c | |
parent | cbab863627c02d4366e337e48e9d570110feb6e4 (diff) | |
download | gdk-pixbuf-e1634f474b67dbd4eb14ac18be53e2adf976e1d1.tar.gz |
replace gboolean free_last in the function parameters with gint depth.
Tue Nov 20 23:01:01 2001 Kristian Rietveld <kristian@planet.nl>
* gtk/gtktreemodel.c (gtk_tree_row_reference_unref_path):
replace gboolean free_last in the function parameters with
gint depth. Changes to reflect new situation.
* gtk/gtktreemodel.c (gtk_tree_row_reference_unref_path_helper):
replace gboolean free_last, with gint depth, add gint current_depth.
Changes to reflect new situation.
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): changes
to reflect new situation
* gtk/gtktreemodel.c (gtk_tree_row_reference_free): ditto
Diffstat (limited to 'gtk/gtktreemodel.c')
-rw-r--r-- | gtk/gtktreemodel.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 6800aa199..ec0e8f07e 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -1182,7 +1182,8 @@ gtk_tree_model_foreach (GtkTreeModel *model, static void gtk_tree_row_reference_unref_path (GtkTreePath *path, GtkTreeModel *model, - gboolean free_last); + gint depth); + #define ROW_REF_DATA_STRING "gtk-tree-row-refs" @@ -1323,7 +1324,7 @@ gtk_tree_row_ref_deleted_callback (GObject *object, /* We know it affects us. */ if (path->indices[i] == reference->path->indices[i]) { - gtk_tree_row_reference_unref_path (reference->path, reference->model, FALSE); + gtk_tree_row_reference_unref_path (reference->path, reference->model, reference->path->depth - 1); gtk_tree_path_free (reference->path); reference->path = NULL; } @@ -1412,32 +1413,30 @@ gtk_tree_row_reference_unref_path_helper (GtkTreePath *path, GtkTreeModel *model, GtkTreeIter *parent_iter, gint depth, - gboolean free_last) + gint current_depth) { GtkTreeIter iter; - if (free_last == FALSE && path->depth - 1 == depth) - return; - if (path->depth == depth) + if (depth == current_depth) return; - gtk_tree_model_iter_nth_child (model, &iter, parent_iter, path->indices[depth]); - gtk_tree_row_reference_unref_path_helper (path, model, &iter, depth + 1, free_last); + gtk_tree_model_iter_nth_child (model, &iter, parent_iter, path->indices[current_depth]); + gtk_tree_row_reference_unref_path_helper (path, model, &iter, depth, current_depth + 1); gtk_tree_model_unref_node (model, &iter); } static void gtk_tree_row_reference_unref_path (GtkTreePath *path, GtkTreeModel *model, - gboolean free_last) + gint depth) { GtkTreeIter iter; - if (free_last == FALSE && path->depth == 1) + if (depth <= 0) return; - + gtk_tree_model_iter_nth_child (model, &iter, NULL, path->indices[0]); - gtk_tree_row_reference_unref_path_helper (path, model, &iter, 1, free_last); + gtk_tree_row_reference_unref_path_helper (path, model, &iter, depth, 1); gtk_tree_model_unref_node (model, &iter); } @@ -1620,7 +1619,7 @@ gtk_tree_row_reference_free (GtkTreeRowReference *reference) if (reference->path) { - gtk_tree_row_reference_unref_path (reference->path, reference->model, TRUE); + gtk_tree_row_reference_unref_path (reference->path, reference->model, reference->path->depth); gtk_tree_path_free (reference->path); } |