[gnome-builder] tree: force clear cached nodes when setting new root



commit 5fcafaddfe28a20aca3b0a58191060d717177069
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 14 15:23:59 2015 -0700

    tree: force clear cached nodes when setting new root
    
    Just as an added precaution.

 src/tree/gb-tree.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/tree/gb-tree.c b/src/tree/gb-tree.c
index ae854a6..c9a7e13 100644
--- a/src/tree/gb-tree.c
+++ b/src/tree/gb-tree.c
@@ -1303,6 +1303,7 @@ gb_tree_set_root (GbTree     *self,
   if (priv->root != root)
     {
       GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (self));
+      GtkTreeModel *current;
 
       gtk_tree_selection_unselect_all (selection);
 
@@ -1314,6 +1315,10 @@ gb_tree_set_root (GbTree     *self,
           g_clear_object (&priv->root);
         }
 
+      current = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
+      if (GTK_IS_TREE_MODEL_FILTER (current))
+        gtk_tree_model_filter_clear_cache (GTK_TREE_MODEL_FILTER (current));
+
       if (root != NULL)
         {
           priv->root = g_object_ref_sink (root);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]