[geany/geany] 397336: Merge pull request #486 from techee/fix_empty_symbol_tree

Colomban Wendling git-noreply at xxxxx
Wed May 6 16:51:43 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Wed, 06 May 2015 16:51:43 UTC
Commit:      3973362c1bb844754c7e05e6da5b3c4c278eef13
             https://github.com/geany/geany/commit/3973362c1bb844754c7e05e6da5b3c4c278eef13

Log Message:
-----------
Merge pull request #486 from techee/fix_empty_symbol_tree

Fix empty symbol tree under some conditions


Modified Paths:
--------------
    src/documentprivate.h
    src/sidebar.c

Modified: src/documentprivate.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -78,6 +78,8 @@ typedef struct GeanyDocumentPrivate
 	GtkWidget		*tag_tree;
 	/* GtkTreeStore object for this document within the Symbols treeview of the sidebar. */
 	GtkTreeStore	*tag_store;
+	/* Indicates whether tag tree has to be updated */
+	gboolean		tag_tree_dirty;
 	/* Iter for this document within the Open Files treeview of the sidebar. */
 	GtkTreeIter		 iter;
 	/* Used by the Undo/Redo management code. */


Modified: src/sidebar.c
8 lines changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -192,6 +192,9 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
 
 	g_return_if_fail(doc == NULL || doc->is_valid);
 
+	if (update)
+		doc->priv->tag_tree_dirty = TRUE;
+
 	if (gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)) != TREEVIEW_SYMBOL)
 		return; /* don't bother updating symbol tree if we don't see it */
 
@@ -219,7 +222,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
 		return;
 	}
 
-	if (update)
+	if (doc->priv->tag_tree_dirty)
 	{	/* updating the tag list in the left tag window */
 		if (doc->priv->tag_tree == NULL)
 		{
@@ -232,6 +235,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
 		}
 
 		doc->has_tags = symbols_recreate_tag_list(doc, SYMBOLS_SORT_USE_PREVIOUS);
+		doc->priv->tag_tree_dirty = FALSE;
 	}
 
 	if (doc->has_tags)
@@ -1088,7 +1092,7 @@ static void on_sidebar_switch_page(GtkNotebook *notebook,
 	gpointer page, guint page_num, gpointer user_data)
 {
 	if (page_num == TREEVIEW_SYMBOL)
-		sidebar_update_tag_list(document_get_current(), TRUE);
+		sidebar_update_tag_list(document_get_current(), FALSE);
 }
 
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list