<p>In <a href="https://github.com/geany/geany/pull/797#discussion_r48686289">src/symbols.c</a>:</p>
<pre style='color:#555'>> }
> - *list = g_list_prepend(*list, g_slice_dup(GtkTreeIter, iter));
> +
> + gtk_tree_model_get(GTK_TREE_MODEL(store), iter, SYMBOLS_COLUMN_TAG, &tag, -1);
</pre>
<p>something like this</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/src/symbols.c b/src/symbols.c</span>
index fed7b2f..cee0d1b 100644
<span class="pl-md">--- a/src/symbols.c</span>
<span class="pl-mi1">+++ b/src/symbols.c</span>
<span class="pl-mdr">@@ -1315,24 +1315,20 @@</span> static void parents_table_tree_value_free(gpointer data)
/* adds a new element in the parent table if it's key is known. */
<span class="pl-md">-static void update_parents_table(GHashTable *table, gchar *name, const gchar *parent_name,</span>
<span class="pl-md">- GtkTreeIter *iter, GtkTreeStore *store)</span>
<span class="pl-mi1">+static void update_parents_table(GHashTable *table, const TMTag *tag, const gchar *parent_name,</span>
<span class="pl-mi1">+ const GtkTreeIter *iter)</span>
{
GTree *tree;
<span class="pl-md">- if (g_hash_table_lookup_extended(table, name, NULL, (gpointer *) &tree) &&</span>
<span class="pl-md">- ! utils_str_equal(parent_name, name) /* prevent Foo::Foo from making parent = child */)</span>
<span class="pl-mi1">+ if (g_hash_table_lookup_extended(table, tag->name, NULL, (gpointer *) &tree) &&</span>
<span class="pl-mi1">+ ! utils_str_equal(parent_name, tag->name) /* prevent Foo::Foo from making parent = child */)</span>
{
<span class="pl-md">- TMTag *tag;</span>
<span class="pl-md">-</span>
if (!tree)
{
tree = g_tree_new_full(tree_cmp, NULL, NULL, parents_table_tree_value_free);
<span class="pl-md">- g_hash_table_insert(table, name, tree);</span>
<span class="pl-mi1">+ g_hash_table_insert(table, tag->name, tree);</span>
}
<span class="pl-md">- gtk_tree_model_get(GTK_TREE_MODEL(store), iter, SYMBOLS_COLUMN_TAG, &tag, -1);</span>
g_tree_insert(tree, GINT_TO_POINTER(tag->line), g_slice_dup(GtkTreeIter, iter));
<span class="pl-md">- tm_tag_unref(tag);</span>
}
}
<span class="pl-mdr">@@ -1545,7 +1541,7 @@</span> static void update_tree_tags(GeanyDocument *doc, GList **tags)
g_free(tooltip);
}
<span class="pl-md">- update_parents_table(parents_table, found->name, parent_name, &iter, store);</span>
<span class="pl-mi1">+ update_parents_table(parents_table, found, parent_name, &iter);</span>
/* remove the updated tag from the table and list */
tags_table_remove(tags_table, found);
<span class="pl-mdr">@@ -1604,7 +1600,7 @@</span> static void update_tree_tags(GeanyDocument *doc, GList **tags)
if (G_LIKELY(icon))
g_object_unref(icon);
<span class="pl-md">- update_parents_table(parents_table, tag->name, parent_name, &iter, store);</span>
<span class="pl-mi1">+ update_parents_table(parents_table, tag, parent_name, &iter);</span>
if (expand)
tree_view_expand_to_iter(GTK_TREE_VIEW(doc->priv->tag_tree), &iter);</pre></div>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/797/files#r48686289">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ00DtJrDeUKmTlLRRT0ebK4uvc5pks5pWAmVgaJpZM4G0Ju3.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/geany/geany/pull/797/files#r48686289"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>