[gnome-builder] project-tree: set directory settings after insertion



commit a47606bd0ca822b98d649c9487a05ba122e1621d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Dec 5 18:10:57 2017 -0800

    project-tree: set directory settings after insertion
    
    We need this to be called after inserting the child so that
    the tree ensures the items are rebuilt as necessary.

 src/plugins/project-tree/gb-project-tree-builder.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/project-tree/gb-project-tree-builder.c 
b/src/plugins/project-tree/gb-project-tree-builder.c
index 308efa6..a6b6936 100644
--- a/src/plugins/project-tree/gb-project-tree-builder.c
+++ b/src/plugins/project-tree/gb-project-tree-builder.c
@@ -110,16 +110,21 @@ gb_project_tree_builder_add (GbProjectTreeBuilder *self,
                         "item", item,
                         NULL);
 
+  /*
+   * Insertion sort our child, which should now only have valid siblings or
+   * be the first child of the parent.
+   */
+  dzl_tree_node_insert_sorted (parent, child, compare_nodes_func, self);
+
+  /*
+   * Set directory settings for the node if it is a directory. We need to do
+   * this after inserting the node so the settings take effect propertly.
+   */
   if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
     {
       dzl_tree_node_set_children_possible (child, TRUE);
       dzl_tree_node_set_reset_on_collapse (child, TRUE);
     }
-
-  /* Insertion sort our child, which should now only have valid siblings
-   * or be the first child of the parent.
-   */
-  dzl_tree_node_insert_sorted (parent, child, compare_nodes_func, self);
 }
 
 static DzlTreeNode *


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