[libdazzle] tree: avoid returning dummy nodes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] tree: avoid returning dummy nodes
- Date: Wed, 6 Dec 2017 02:14:18 +0000 (UTC)
commit d8a42a7b9ba9feb4eb55b03d0eff283d9f658681
Author: Christian Hergert <chergert redhat com>
Date: Tue Dec 5 18:13:12 2017 -0800
tree: avoid returning dummy nodes
src/tree/dzl-tree-node.c | 4 ++++
src/tree/dzl-tree.c | 1 +
2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/tree/dzl-tree-node.c b/src/tree/dzl-tree-node.c
index 04b0a4e..05b357e 100644
--- a/src/tree/dzl-tree-node.c
+++ b/src/tree/dzl-tree-node.c
@@ -1288,6 +1288,10 @@ dzl_tree_node_nth_child (DzlTreeNode *self,
gtk_tree_model_get (model, &iter, 0, &node, -1);
g_assert (DZL_IS_TREE_NODE (node));
+ /* Don't hand back a dummy node */
+ if (_dzl_tree_node_is_dummy (node))
+ return NULL;
+
return g_steal_pointer (&node);
}
}
diff --git a/src/tree/dzl-tree.c b/src/tree/dzl-tree.c
index db3391b..35f890c 100644
--- a/src/tree/dzl-tree.c
+++ b/src/tree/dzl-tree.c
@@ -522,6 +522,7 @@ _dzl_tree_insert_sorted (DzlTree *self,
_dzl_tree_node_set_tree (child, self);
_dzl_tree_node_set_parent (child, node);
+ _dzl_tree_node_set_needs_build (child, TRUE);
g_object_ref_sink (child);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]