don't try to fetch the child back, since we do know that it is already
Tue Nov 18 20:51:38 2003 Kristian Rietveld <kris@gtk.org> * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_deleted): don't try to fetch the child back, since we do know that it is already gone by now (#126493, Marco Pesenti Gritti).
This commit is contained in:
parent
e9154691d1
commit
a0e4889748
@ -1,3 +1,9 @@
|
|||||||
|
Tue Nov 18 20:51:38 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_deleted): don't
|
||||||
|
try to fetch the child back, since we do know that it is already
|
||||||
|
gone by now (#126493, Marco Pesenti Gritti).
|
||||||
|
|
||||||
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
Fixes based on comments from Owen Taylor, #125264.
|
Fixes based on comments from Owen Taylor, #125264.
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Tue Nov 18 20:51:38 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_deleted): don't
|
||||||
|
try to fetch the child back, since we do know that it is already
|
||||||
|
gone by now (#126493, Marco Pesenti Gritti).
|
||||||
|
|
||||||
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
Fixes based on comments from Owen Taylor, #125264.
|
Fixes based on comments from Owen Taylor, #125264.
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Tue Nov 18 20:51:38 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_deleted): don't
|
||||||
|
try to fetch the child back, since we do know that it is already
|
||||||
|
gone by now (#126493, Marco Pesenti Gritti).
|
||||||
|
|
||||||
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
Fixes based on comments from Owen Taylor, #125264.
|
Fixes based on comments from Owen Taylor, #125264.
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Tue Nov 18 20:51:38 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_deleted): don't
|
||||||
|
try to fetch the child back, since we do know that it is already
|
||||||
|
gone by now (#126493, Marco Pesenti Gritti).
|
||||||
|
|
||||||
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
Fixes based on comments from Owen Taylor, #125264.
|
Fixes based on comments from Owen Taylor, #125264.
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Tue Nov 18 20:51:38 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_deleted): don't
|
||||||
|
try to fetch the child back, since we do know that it is already
|
||||||
|
gone by now (#126493, Marco Pesenti Gritti).
|
||||||
|
|
||||||
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
Fixes based on comments from Owen Taylor, #125264.
|
Fixes based on comments from Owen Taylor, #125264.
|
||||||
|
@ -1430,88 +1430,79 @@ gtk_tree_model_filter_row_deleted (GtkTreeModel *c_model,
|
|||||||
c_path,
|
c_path,
|
||||||
FALSE,
|
FALSE,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
{
|
{
|
||||||
path = gtk_real_tree_model_filter_convert_child_path_to_path (filter,
|
/* fixup the offsets */
|
||||||
c_path,
|
GtkTreePath *real_path;
|
||||||
FALSE,
|
|
||||||
TRUE);
|
|
||||||
|
|
||||||
if (!path)
|
if (!filter->priv->root)
|
||||||
|
return;
|
||||||
|
|
||||||
|
level = FILTER_LEVEL (filter->priv->root);
|
||||||
|
|
||||||
|
/* subtract vroot if necessary */
|
||||||
|
if (filter->priv->virtual_root)
|
||||||
{
|
{
|
||||||
/* fixup the offsets */
|
real_path = gtk_tree_model_filter_remove_root (c_path,
|
||||||
GtkTreePath *real_path;
|
filter->priv->virtual_root);
|
||||||
|
/* we don't handle this */
|
||||||
if (!filter->priv->root)
|
if (!real_path)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
real_path = gtk_tree_path_copy (c_path);
|
||||||
|
|
||||||
level = FILTER_LEVEL (filter->priv->root);
|
i = 0;
|
||||||
|
if (gtk_tree_path_get_depth (real_path) - 1 >= 1)
|
||||||
/* subtract vroot if necessary */
|
{
|
||||||
if (filter->priv->virtual_root)
|
while (i < gtk_tree_path_get_depth (real_path) - 1)
|
||||||
{
|
{
|
||||||
real_path = gtk_tree_model_filter_remove_root (c_path,
|
gint j;
|
||||||
filter->priv->virtual_root);
|
|
||||||
/* we don't handle this */
|
|
||||||
if (!real_path)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
real_path = gtk_tree_path_copy (c_path);
|
|
||||||
|
|
||||||
i = 0;
|
if (!level)
|
||||||
if (gtk_tree_path_get_depth (real_path) - 1 >= 1)
|
|
||||||
{
|
|
||||||
while (i < gtk_tree_path_get_depth (real_path) - 1)
|
|
||||||
{
|
{
|
||||||
gint j;
|
/* we don't cover this */
|
||||||
|
gtk_tree_path_free (real_path);
|
||||||
if (!level)
|
return;
|
||||||
{
|
|
||||||
/* we don't cover this */
|
|
||||||
gtk_tree_path_free (real_path);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
elt = bsearch_elt_with_offset (level->array,
|
|
||||||
gtk_tree_path_get_indices (real_path)[i],
|
|
||||||
&j);
|
|
||||||
|
|
||||||
if (!elt || !elt->children)
|
|
||||||
{
|
|
||||||
/* parent is filtered out, so no level */
|
|
||||||
gtk_tree_path_free (real_path);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
level = elt->children;
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elt = bsearch_elt_with_offset (level->array,
|
||||||
|
gtk_tree_path_get_indices (real_path)[i],
|
||||||
|
&j);
|
||||||
|
|
||||||
|
if (!elt || !elt->children)
|
||||||
|
{
|
||||||
|
/* parent is filtered out, so no level */
|
||||||
|
gtk_tree_path_free (real_path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
level = elt->children;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = gtk_tree_path_get_indices (real_path)[gtk_tree_path_get_depth (real_path) - 1];
|
|
||||||
gtk_tree_path_free (real_path);
|
|
||||||
|
|
||||||
if (!level)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* we need:
|
|
||||||
* - the offset of the removed item
|
|
||||||
* - the level
|
|
||||||
*/
|
|
||||||
for (i = 0; i < level->array->len; i++)
|
|
||||||
{
|
|
||||||
elt = &g_array_index (level->array, FilterElt, i);
|
|
||||||
if (elt->offset > offset)
|
|
||||||
elt->offset--;
|
|
||||||
if (elt->children)
|
|
||||||
elt->children->parent_elt = elt;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emit_signal = FALSE;
|
offset = gtk_tree_path_get_indices (real_path)[gtk_tree_path_get_depth (real_path) - 1];
|
||||||
|
gtk_tree_path_free (real_path);
|
||||||
|
|
||||||
|
if (!level)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* we need:
|
||||||
|
* - the offset of the removed item
|
||||||
|
* - the level
|
||||||
|
*/
|
||||||
|
for (i = 0; i < level->array->len; i++)
|
||||||
|
{
|
||||||
|
elt = &g_array_index (level->array, FilterElt, i);
|
||||||
|
if (elt->offset > offset)
|
||||||
|
elt->offset--;
|
||||||
|
if (elt->children)
|
||||||
|
elt->children->parent_elt = elt;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
|
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
|
||||||
|
Loading…
Reference in New Issue
Block a user