In sort model also emit row-deleted after updating the data structures

This commit is contained in:
Kristian Rietveld 2011-05-09 10:29:54 +02:00
parent e9c960929b
commit df0fcfb940

View File

@ -901,12 +901,6 @@ 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)
@ -919,7 +913,9 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
* Careful, root level is not cleaned up in increment stamp.
*/
gtk_tree_model_sort_increment_stamp (tree_model_sort);
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
gtk_tree_path_free (path);
if (level == tree_model_sort->priv->root)
{
gtk_tree_model_sort_free_level (tree_model_sort,
@ -929,8 +925,6 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
return;
}
gtk_tree_model_sort_increment_stamp (tree_model_sort);
/* Remove the row */
for (i = 0; i < level->array->len; i++)
if (elt->offset == g_array_index (level->array, SortElt, i).offset)
@ -948,6 +942,9 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
elt->children->parent_elt_index = i;
}
gtk_tree_model_sort_increment_stamp (tree_model_sort);
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
gtk_tree_path_free (path);
}