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.
This commit is contained in:
parent
1cc88c4cf8
commit
67051d64f4
9 changed files with 87 additions and 11 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
|
||||
|
|
|
|||
|
|
@ -1334,17 +1334,11 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
|
|||
gint i;
|
||||
|
||||
if (path->depth > reference->path->depth)
|
||||
{
|
||||
tmp_list = g_slist_next (tmp_list);
|
||||
continue;
|
||||
}
|
||||
goto next;
|
||||
for (i = 0; i < path->depth - 1; i++)
|
||||
{
|
||||
if (path->indices[i] != reference->path->indices[i])
|
||||
{
|
||||
tmp_list = g_slist_next (tmp_list);
|
||||
continue;
|
||||
}
|
||||
goto next;
|
||||
}
|
||||
|
||||
/* We know it affects us. */
|
||||
|
|
@ -1359,6 +1353,8 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
|
|||
reference->path->indices[path->depth-1]-=1;
|
||||
}
|
||||
}
|
||||
|
||||
next:
|
||||
tmp_list = g_slist_next (tmp_list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -693,6 +693,14 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
|
|||
elt = SORT_ELT (iter.user_data2);
|
||||
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)
|
||||
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,
|
|||
/* This will prune the level, so I can just emit the signal and not worry
|
||||
* about cleaning this level up. */
|
||||
gtk_tree_model_sort_increment_stamp (tree_model_sort);
|
||||
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
|
||||
gtk_tree_path_free (path);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_tree_model_sort_increment_stamp (tree_model_sort);
|
||||
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
|
||||
|
||||
/* Remove the row */
|
||||
for (i = 0; i < level->array->len; i++)
|
||||
|
|
@ -2141,7 +2147,11 @@ gtk_tree_model_sort_free_level (GtkTreeModelSort *tree_model_sort,
|
|||
static void
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue