From 40c139384b25e89f9308f0d493e1c9ff0318a3cb Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Sun, 22 Apr 2018 14:48:21 +0200
Subject: Reorganized the symbol panel only when the treeview is connected to
 its model.

---
 src/gui/panels/symbols.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index f016199..fa671a4 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -695,10 +695,7 @@ static void reload_symbols_panel_content(const GSymbolsPanel *panel, GtkStatusSt
         reload_symbols_for_new_list_view(panel, status, id, data);
 
     else
-    {
         reload_symbols_for_new_tree_view(panel, status, id, data);
-        reorganize_symbols_tree_view(NULL, panel);
-    }
 
 }
 
@@ -1676,6 +1673,7 @@ static void g_symbols_panel_conclude(GSymbolsPanel *panel, unsigned int uid, sym
     GtkTreeView *treeview;                  /* Arborescence graphique      */
     size_t i;                               /* Boucle de parcours          */
     GtkTreePath *path;                      /* Chemin d'accès à un noeud   */
+    GtkToggleToolButton *button;            /* Mode de représentation      */
 
     /* Mise à jour des compteurs */
 
@@ -1701,6 +1699,13 @@ static void g_symbols_panel_conclude(GSymbolsPanel *panel, unsigned int uid, sym
 
     }
 
+    /* Réorganisation des symboles ? */
+
+    button = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builder, "list_display"));
+
+    if (!gtk_toggle_tool_button_get_active(button))
+        reorganize_symbols_tree_view(NULL, panel);
+
     g_panel_item_switch_to_updated_content(G_PANEL_ITEM(panel));
 
 }
-- 
cgit v0.11.2-87-g4458