[easytag/wip/glist: 6/7] Refactor list handling in bar.c



commit 30c11e7b288ec72c8ac5c6c62f67bcec155d62ca
Author: David King <amigadave amigadave com>
Date:   Fri May 24 00:00:51 2013 +0100

    Refactor list handling in bar.c

 src/bar.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/bar.c b/src/bar.c
index f4be4c4..305a867 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -371,7 +371,7 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
         Action_Pair* ActionPair = g_malloc0(sizeof(Action_Pair));
         ActionPair->action = ActionEntries[i].name;
         ActionPair->quark  = g_quark_from_string(ActionPair->action);
-        ActionPairsList    = g_list_append(ActionPairsList, ActionPair);
+        ActionPairsList = g_list_prepend (ActionPairsList, ActionPair);
     }
 
     for(i = 0; i < num_toggle_entries; i++)
@@ -379,9 +379,11 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
         Action_Pair* ActionPair = g_malloc0(sizeof(Action_Pair));
         ActionPair->action = ToggleActionEntries[i].name;
         ActionPair->quark  = g_quark_from_string(ActionPair->action);
-        ActionPairsList    = g_list_append(ActionPairsList, ActionPair);
+        ActionPairsList = g_list_prepend (ActionPairsList, ActionPair);
     }
 
+    ActionPairsList = g_list_reverse (ActionPairsList);
+
     /* UI Management */
     ActionGroup = gtk_action_group_new("actions");
     gtk_action_group_add_actions(ActionGroup, ActionEntries, num_menu_entries, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]