[gnome-builder/gnome-builder-3-26] symbol-tree: ignore empty trees
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-26] symbol-tree: ignore empty trees
- Date: Sat, 6 Jan 2018 12:02:37 +0000 (UTC)
commit e4c9243f1e429b7a9c66cfc668af7a09148b3597
Author: Christian Hergert <chergert redhat com>
Date: Sat Jan 6 03:59:04 2018 -0800
symbol-tree: ignore empty trees
We might get a valid tree pointer back, but it contains no
children nodes. In this case, simply ignore the tree and
instead try the next symbol resolver who might have something
more interesting.
.../symbol-tree/gbp-symbol-layout-stack-addin.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
b/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
index 5575101..2b0233b 100644
--- a/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
+++ b/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
@@ -229,8 +229,12 @@ gbp_symbol_layout_stack_addin_get_symbol_tree_cb (GObject *object,
g_ptr_array_remove_index (data->resolvers, data->resolvers->len - 1);
+ /* Ignore empty trees, in favor of next symbol resovler */
+ if (tree != NULL && ide_symbol_tree_get_n_children (tree, NULL) == 0)
+ g_clear_object (&tree);
+
/* If tree is not fetched and symbol resolvers are left then try those */
- if (tree == NULL && data->resolvers->len)
+ if (tree == NULL && data->resolvers->len > 0)
{
GFile *file;
IdeSymbolResolver *resolver;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]