short-circuit in case an empty root level would be build (and thus

2008-03-05  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_inserted):
	short-circuit in case an empty root level would be build (and thus
	directly destroyed) if no virtual root has been set.


svn path=/trunk/; revision=19712
This commit is contained in:
Kristian Rietveld 2008-03-05 10:36:35 +00:00 committed by Kristian Rietveld
parent 9b26a1c319
commit 4e6561b2b2
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-03-05 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_inserted):
short-circuit in case an empty root level would be build (and thus
directly destroyed) if no virtual root has been set.
2008-03-04 Matthias Clasen <mclasen@redhat.com> 2008-03-04 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/cups/gtkprintbackendcups.c: * modules/printbackends/cups/gtkprintbackendcups.c:

View File

@ -1373,6 +1373,11 @@ gtk_tree_model_filter_row_inserted (GtkTreeModel *c_model,
if (!filter->priv->root) if (!filter->priv->root)
{ {
/* No point in building the level if this node is not visible. */
if (!filter->priv->virtual_root
&& !gtk_tree_model_filter_visible (filter, c_iter))
goto done;
/* build level will pull in the new child */ /* build level will pull in the new child */
gtk_tree_model_filter_build_level (filter, NULL, NULL, FALSE); gtk_tree_model_filter_build_level (filter, NULL, NULL, FALSE);