[gnome-builder] tree: clear selection before rebuildign the tree



commit 1b04722c4fc588afff8db6c6b7d35db5d8694cc1
Author: Christian Hergert <christian hergert me>
Date:   Wed Apr 15 17:42:40 2015 -0700

    tree: clear selection before rebuildign the tree

 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 51e47aa..9fb1c0a 100644
--- a/src/tree/gb-tree.c
+++ b/src/tree/gb-tree.c
@@ -753,11 +753,16 @@ gb_tree_rebuild (GbTree *tree)
 {
   GbTreePrivate *priv;
   GbTreeNode *root;
+  GtkTreeSelection *selection;
 
   g_return_if_fail (GB_IS_TREE (tree));
 
   priv = tree->priv;
 
+  /* avoid dealign with selection changes while rebuilding */
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
+  gtk_tree_selection_unselect_all (selection);
+
   if ((root = priv->root ? g_object_ref (priv->root) : NULL))
     {
       gb_tree_set_root (tree, root);


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