gtktreemodelfilter: child levels of the root level must remain cached

This is due to the special handling for filter functions that depend
on child level state.  If the parent level of a level is the root level,
the level cannot be removed from the cache.  Any change in this level
can cause its parent in the root level to become visible again.
This commit is contained in:
Kristian Rietveld 2011-09-07 22:11:37 +02:00
parent ae2b2e7cfc
commit 022327c408

View File

@ -1302,9 +1302,13 @@ gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter,
* free the level if the parent level also has an external ref
* count of zero. In that case, changes concerning our parent are
* not requested.
*
* The root level is always visible, so an exception holds for levels
* with the root level as parent level: these have to remain cached.
*/
if (level->ext_ref_count == 0 && level != filter->priv->root &&
level->parent_level && level->parent_level->ext_ref_count == 0)
level->parent_level && level->parent_level != filter->priv->root &&
level->parent_level->ext_ref_count == 0)
{
gtk_tree_model_filter_free_level (filter, level, TRUE, FALSE);
return;