Commit 67051d64 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

emit row_deleted before we start unreffing the nodes ourselves

Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
        row_deleted before we start unreffing the nodes ourselves
        (gtk_tree_model_sort_increment_stamp): always increment the stamp,
        and not only if the stamp equals 0 (pointed out by Darin Adler)

        * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
        to continue the while loop and not the nested for loop.
parent 1cc88c4c
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
Tue Feb 12 14:27:41 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
row_deleted before we start unreffing the nodes ourselves
(gtk_tree_model_sort_increment_stamp): always increment the stamp,
and not only if the stamp equals 0 (pointed out by Darin Adler)
* gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
to continue the while loop and not the nested for loop.
Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org> Tue Feb 12 02:19:49 2002 Tim Janik <timj@gtk.org>
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
......
...@@ -1334,17 +1334,11 @@ gtk_tree_row_ref_deleted_callback (GObject *object, ...@@ -1334,17 +1334,11 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
gint i; gint i;
if (path->depth > reference->path->depth) if (path->depth > reference->path->depth)
{ goto next;
tmp_list = g_slist_next (tmp_list);
continue;
}
for (i = 0; i < path->depth - 1; i++) for (i = 0; i < path->depth - 1; i++)
{ {
if (path->indices[i] != reference->path->indices[i]) if (path->indices[i] != reference->path->indices[i])
{ goto next;
tmp_list = g_slist_next (tmp_list);
continue;
}
} }
/* We know it affects us. */ /* We know it affects us. */
...@@ -1359,6 +1353,8 @@ gtk_tree_row_ref_deleted_callback (GObject *object, ...@@ -1359,6 +1353,8 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
reference->path->indices[path->depth-1]-=1; reference->path->indices[path->depth-1]-=1;
} }
} }
next:
tmp_list = g_slist_next (tmp_list); tmp_list = g_slist_next (tmp_list);
} }
} }
......
...@@ -693,6 +693,14 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model, ...@@ -693,6 +693,14 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
elt = SORT_ELT (iter.user_data2); elt = SORT_ELT (iter.user_data2);
offset = elt->offset; offset = elt->offset;
/* we _need_ to emit ::row_deleted before we start unreffing the node
* itself. This is because of the row refs, which start unreffing nodes
* when we emit ::row_deleted
*/
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
while (elt->ref_count > 0) while (elt->ref_count > 0)
gtk_tree_model_sort_real_unref_node (GTK_TREE_MODEL (data), &iter, FALSE); gtk_tree_model_sort_real_unref_node (GTK_TREE_MODEL (data), &iter, FALSE);
...@@ -701,13 +709,11 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model, ...@@ -701,13 +709,11 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
/* This will prune the level, so I can just emit the signal and not worry /* This will prune the level, so I can just emit the signal and not worry
* about cleaning this level up. */ * about cleaning this level up. */
gtk_tree_model_sort_increment_stamp (tree_model_sort); gtk_tree_model_sort_increment_stamp (tree_model_sort);
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
gtk_tree_path_free (path); gtk_tree_path_free (path);
return; return;
} }
gtk_tree_model_sort_increment_stamp (tree_model_sort); gtk_tree_model_sort_increment_stamp (tree_model_sort);
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
/* Remove the row */ /* Remove the row */
for (i = 0; i < level->array->len; i++) for (i = 0; i < level->array->len; i++)
...@@ -2141,7 +2147,11 @@ gtk_tree_model_sort_free_level (GtkTreeModelSort *tree_model_sort, ...@@ -2141,7 +2147,11 @@ gtk_tree_model_sort_free_level (GtkTreeModelSort *tree_model_sort,
static void static void
gtk_tree_model_sort_increment_stamp (GtkTreeModelSort *tree_model_sort) gtk_tree_model_sort_increment_stamp (GtkTreeModelSort *tree_model_sort)
{ {
while (tree_model_sort->stamp == 0) tree_model_sort->stamp++; do
{
tree_model_sort->stamp++;
}
while (tree_model_sort->stamp == 0);
gtk_tree_model_sort_clear_cache (tree_model_sort); gtk_tree_model_sort_clear_cache (tree_model_sort);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment