[gnome-builder/gnome-builder-3-18] tree: use insert_with_values()



commit b8e778d0629f702a9794f3e9e83244d71fe08c84
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 14 15:22:44 2015 -0700

    tree: use insert_with_values()
    
    This allows us to avoid the intermittent state of an inserted iter but
    without a node set.

 src/tree/gb-tree.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/tree/gb-tree.c b/src/tree/gb-tree.c
index e3ecd12..a51e687 100644
--- a/src/tree/gb-tree.c
+++ b/src/tree/gb-tree.c
@@ -524,12 +524,10 @@ gb_tree_add (GbTree     *self,
       g_clear_pointer (&path, gtk_tree_path_free);
     }
 
-  if (prepend)
-    gtk_tree_store_prepend (priv->store, &iter, parentptr);
-  else
-    gtk_tree_store_append (priv->store, &iter, parentptr);
-
-  gtk_tree_store_set (priv->store, &iter, 0, child, -1);
+  gtk_tree_store_insert_with_values (priv->store, &iter, parentptr,
+                                     prepend ? 0 : -1,
+                                     0, child,
+                                     -1);
 
   if (node == priv->root)
     _gb_tree_build_node (self, child);


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