From fb3b86f2cd49f3f52d0d8438951ed07b8b12be8b Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 21 Oct 2011 20:23:06 +0400 Subject: [PATCH] Optimization of menu creation. Avoid a lot of iteration through the list of menu entries. Signed-off-by: Andrew Borodin --- src/editor/editmenu.c | 179 +++++++++++++++++++++++---------------------- src/filemanager/midnight.c | 159 ++++++++++++++++++++-------------------- 2 files changed, 170 insertions(+), 168 deletions(-) diff --git a/src/editor/editmenu.c b/src/editor/editmenu.c index 9fffd66e1..315cf8a75 100644 --- a/src/editor/editmenu.c +++ b/src/editor/editmenu.c @@ -69,22 +69,22 @@ create_file_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Open file..."), CK_EditFile)); - entries = g_list_append (entries, menu_entry_create (_("&New"), CK_EditNew)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Save"), CK_Save)); - entries = g_list_append (entries, menu_entry_create (_("Save &as..."), CK_SaveAs)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Insert file..."), CK_InsertFile)); - entries = g_list_append (entries, menu_entry_create (_("Cop&y to file..."), CK_BlockSave)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&User menu..."), CK_UserMenu)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("A&bout..."), CK_About)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Quit"), CK_Quit)); - - return entries; + entries = g_list_prepend (entries, menu_entry_create (_("&Open file..."), CK_EditFile)); + entries = g_list_prepend (entries, menu_entry_create (_("&New"), CK_EditNew)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Save"), CK_Save)); + entries = g_list_prepend (entries, menu_entry_create (_("Save &as..."), CK_SaveAs)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Insert file..."), CK_InsertFile)); + entries = g_list_prepend (entries, menu_entry_create (_("Cop&y to file..."), CK_BlockSave)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&User menu..."), CK_UserMenu)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("A&bout..."), CK_About)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Quit"), CK_Quit)); + + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -94,29 +94,29 @@ create_edit_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Undo"), CK_Undo)); - entries = g_list_append (entries, menu_entry_create (_("&Redo"), CK_Redo)); - entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Undo"), CK_Undo)); + entries = g_list_prepend (entries, menu_entry_create (_("&Redo"), CK_Redo)); + entries = g_list_prepend (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("&Toggle ins/overw"), CK_InsertOverwrite)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("To&ggle mark"), CK_Mark)); - entries = g_list_append (entries, menu_entry_create (_("&Mark columns"), CK_MarkColumn)); - entries = g_list_append (entries, menu_entry_create (_("Mark &all"), CK_MarkAll)); - entries = g_list_append (entries, menu_entry_create (_("Unmar&k"), CK_Unmark)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Cop&y"), CK_Copy)); - entries = g_list_append (entries, menu_entry_create (_("Mo&ve"), CK_Move)); - entries = g_list_append (entries, menu_entry_create (_("&Delete"), CK_Remove)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Co&py to clipfile"), CK_Store)); - entries = g_list_append (entries, menu_entry_create (_("&Cut to clipfile"), CK_Cut)); - entries = g_list_append (entries, menu_entry_create (_("Pa&ste from clipfile"), CK_Paste)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Beginning"), CK_Top)); - entries = g_list_append (entries, menu_entry_create (_("&End"), CK_Bottom)); - - return entries; + g_list_prepend (entries, menu_entry_create (_("&Toggle ins/overw"), CK_InsertOverwrite)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("To&ggle mark"), CK_Mark)); + entries = g_list_prepend (entries, menu_entry_create (_("&Mark columns"), CK_MarkColumn)); + entries = g_list_prepend (entries, menu_entry_create (_("Mark &all"), CK_MarkAll)); + entries = g_list_prepend (entries, menu_entry_create (_("Unmar&k"), CK_Unmark)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("Cop&y"), CK_Copy)); + entries = g_list_prepend (entries, menu_entry_create (_("Mo&ve"), CK_Move)); + entries = g_list_prepend (entries, menu_entry_create (_("&Delete"), CK_Remove)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("Co&py to clipfile"), CK_Store)); + entries = g_list_prepend (entries, menu_entry_create (_("&Cut to clipfile"), CK_Cut)); + entries = g_list_prepend (entries, menu_entry_create (_("Pa&ste from clipfile"), CK_Paste)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Beginning"), CK_Top)); + entries = g_list_prepend (entries, menu_entry_create (_("&End"), CK_Bottom)); + + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -126,16 +126,16 @@ create_search_replace_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Search..."), CK_Search)); - entries = g_list_append (entries, menu_entry_create (_("Search &again"), CK_SearchContinue)); - entries = g_list_append (entries, menu_entry_create (_("&Replace..."), CK_Replace)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Toggle bookmark"), CK_Bookmark)); - entries = g_list_append (entries, menu_entry_create (_("&Next bookmark"), CK_BookmarkNext)); - entries = g_list_append (entries, menu_entry_create (_("&Prev bookmark"), CK_BookmarkPrev)); - entries = g_list_append (entries, menu_entry_create (_("&Flush bookmarks"), CK_BookmarkFlush)); + entries = g_list_prepend (entries, menu_entry_create (_("&Search..."), CK_Search)); + entries = g_list_prepend (entries, menu_entry_create (_("Search &again"), CK_SearchContinue)); + entries = g_list_prepend (entries, menu_entry_create (_("&Replace..."), CK_Replace)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Toggle bookmark"), CK_Bookmark)); + entries = g_list_prepend (entries, menu_entry_create (_("&Next bookmark"), CK_BookmarkNext)); + entries = g_list_prepend (entries, menu_entry_create (_("&Prev bookmark"), CK_BookmarkPrev)); + entries = g_list_prepend (entries, menu_entry_create (_("&Flush bookmarks"), CK_BookmarkFlush)); - return entries; + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -145,38 +145,39 @@ create_command_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Go to line..."), CK_Goto)); - entries = g_list_append (entries, menu_entry_create (_("&Toggle line state"), CK_ShowNumbers)); + entries = g_list_prepend (entries, menu_entry_create (_("&Go to line..."), CK_Goto)); + entries = g_list_prepend (entries, menu_entry_create (_("&Toggle line state"), CK_ShowNumbers)); entries = - g_list_append (entries, menu_entry_create (_("Go to matching &bracket"), CK_MatchBracket)); + g_list_prepend (entries, menu_entry_create (_("Go to matching &bracket"), CK_MatchBracket)); entries = - g_list_append (entries, - menu_entry_create (_("Toggle s&yntax highlighting"), CK_SyntaxOnOff)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Find declaration"), CK_Find)); - entries = g_list_append (entries, menu_entry_create (_("Back from &declaration"), CK_FilePrev)); + g_list_prepend (entries, + menu_entry_create (_("Toggle s&yntax highlighting"), CK_SyntaxOnOff)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Find declaration"), CK_Find)); entries = - g_list_append (entries, menu_entry_create (_("For&ward to declaration"), CK_FileNext)); + g_list_prepend (entries, menu_entry_create (_("Back from &declaration"), CK_FilePrev)); + entries = + g_list_prepend (entries, menu_entry_create (_("For&ward to declaration"), CK_FileNext)); #ifdef HAVE_CHARSET - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Encod&ing..."), CK_SelectCodepage)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("Encod&ing..."), CK_SelectCodepage)); #endif - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Refresh screen"), CK_Refresh)); - entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Refresh screen"), CK_Refresh)); + entries = g_list_prepend (entries, menu_separator_create ()); entries = - g_list_append (entries, - menu_entry_create (_("&Start/Stop record macro"), CK_MacroStartStopRecord)); - entries = g_list_append (entries, menu_entry_create (_("Delete macr&o..."), CK_MacroDelete)); + g_list_prepend (entries, + menu_entry_create (_("&Start/Stop record macro"), CK_MacroStartStopRecord)); + entries = g_list_prepend (entries, menu_entry_create (_("Delete macr&o..."), CK_MacroDelete)); entries = - g_list_append (entries, - menu_entry_create (_("Record/Repeat &actions"), CK_RepeatStartStopRecord)); - entries = g_list_append (entries, menu_separator_create ()); + g_list_prepend (entries, + menu_entry_create (_("Record/Repeat &actions"), CK_RepeatStartStopRecord)); + entries = g_list_prepend (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("'ispell' s&pell check"), CK_PipeBlock (1))); - entries = g_list_append (entries, menu_entry_create (_("&Mail..."), CK_Mail)); + g_list_prepend (entries, menu_entry_create (_("'ispell' s&pell check"), CK_PipeBlock (1))); + entries = g_list_prepend (entries, menu_entry_create (_("&Mail..."), CK_Mail)); - return entries; + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -187,18 +188,18 @@ create_format_menu (void) GList *entries = NULL; entries = - g_list_append (entries, menu_entry_create (_("Insert &literal..."), CK_InsertLiteral)); - entries = g_list_append (entries, menu_entry_create (_("Insert &date/time"), CK_Date)); - entries = g_list_append (entries, menu_separator_create ()); + g_list_prepend (entries, menu_entry_create (_("Insert &literal..."), CK_InsertLiteral)); + entries = g_list_prepend (entries, menu_entry_create (_("Insert &date/time"), CK_Date)); + entries = g_list_prepend (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat)); - entries = g_list_append (entries, menu_entry_create (_("&Sort..."), CK_Sort)); + g_list_prepend (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat)); + entries = g_list_prepend (entries, menu_entry_create (_("&Sort..."), CK_Sort)); entries = - g_list_append (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand)); + g_list_prepend (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand)); entries = - g_list_append (entries, menu_entry_create (_("&External formatter"), CK_PipeBlock (0))); + g_list_prepend (entries, menu_entry_create (_("&External formatter"), CK_PipeBlock (0))); - return entries; + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -208,18 +209,18 @@ create_options_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&General..."), CK_Options)); - entries = g_list_append (entries, menu_entry_create (_("Save &mode..."), CK_OptionsSaveMode)); - entries = g_list_append (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys)); + entries = g_list_prepend (entries, menu_entry_create (_("&General..."), CK_Options)); + entries = g_list_prepend (entries, menu_entry_create (_("Save &mode..."), CK_OptionsSaveMode)); + entries = g_list_prepend (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys)); entries = - g_list_append (entries, menu_entry_create (_("Syntax &highlighting..."), CK_SyntaxChoose)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("S&yntax file"), CK_EditSyntaxFile)); - entries = g_list_append (entries, menu_entry_create (_("&Menu file"), CK_EditUserMenu)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup)); - - return entries; + g_list_prepend (entries, menu_entry_create (_("Syntax &highlighting..."), CK_SyntaxChoose)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("S&yntax file"), CK_EditSyntaxFile)); + entries = g_list_prepend (entries, menu_entry_create (_("&Menu file"), CK_EditUserMenu)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup)); + + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c index c92fe539b..108443f8d 100644 --- a/src/filemanager/midnight.c +++ b/src/filemanager/midnight.c @@ -189,33 +189,33 @@ create_panel_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("File listin&g"), CK_PanelListing)); - entries = g_list_append (entries, menu_entry_create (_("&Quick view"), CK_PanelQuickView)); - entries = g_list_append (entries, menu_entry_create (_("&Info"), CK_PanelInfo)); - entries = g_list_append (entries, menu_entry_create (_("&Tree"), CK_PanelTree)); - entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("File listin&g"), CK_PanelListing)); + entries = g_list_prepend (entries, menu_entry_create (_("&Quick view"), CK_PanelQuickView)); + entries = g_list_prepend (entries, menu_entry_create (_("&Info"), CK_PanelInfo)); + entries = g_list_prepend (entries, menu_entry_create (_("&Tree"), CK_PanelTree)); + entries = g_list_prepend (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("&Listing mode..."), CK_PanelListingChange)); - entries = g_list_append (entries, menu_entry_create (_("&Sort order..."), CK_Sort)); - entries = g_list_append (entries, menu_entry_create (_("&Filter..."), CK_Filter)); + g_list_prepend (entries, menu_entry_create (_("&Listing mode..."), CK_PanelListingChange)); + entries = g_list_prepend (entries, menu_entry_create (_("&Sort order..."), CK_Sort)); + entries = g_list_prepend (entries, menu_entry_create (_("&Filter..."), CK_Filter)); #ifdef HAVE_CHARSET - entries = g_list_append (entries, menu_entry_create (_("&Encoding..."), CK_SelectCodepage)); + entries = g_list_prepend (entries, menu_entry_create (_("&Encoding..."), CK_SelectCodepage)); #endif - entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_separator_create ()); #ifdef ENABLE_VFS_FTP - entries = g_list_append (entries, menu_entry_create (_("FT&P link..."), CK_ConnectFtp)); + entries = g_list_prepend (entries, menu_entry_create (_("FT&P link..."), CK_ConnectFtp)); #endif #ifdef ENABLE_VFS_FISH - entries = g_list_append (entries, menu_entry_create (_("S&hell link..."), CK_ConnectFish)); + entries = g_list_prepend (entries, menu_entry_create (_("S&hell link..."), CK_ConnectFish)); #endif #ifdef ENABLE_VFS_SMB - entries = g_list_append (entries, menu_entry_create (_("SM&B link..."), CK_ConnectSmb)); + entries = g_list_prepend (entries, menu_entry_create (_("SM&B link..."), CK_ConnectSmb)); #endif - entries = g_list_append (entries, menu_entry_create (_("Panelize"), CK_Panelize)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Rescan"), CK_Reread)); + entries = g_list_prepend (entries, menu_entry_create (_("Paneli&ze"), CK_Panelize)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Rescan"), CK_Reread)); - return entries; + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -225,33 +225,33 @@ create_file_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&View"), CK_View)); - entries = g_list_append (entries, menu_entry_create (_("Vie&w file..."), CK_ViewFile)); - entries = g_list_append (entries, menu_entry_create (_("&Filtered view"), CK_ViewFiltered)); - entries = g_list_append (entries, menu_entry_create (_("&Edit"), CK_Edit)); - entries = g_list_append (entries, menu_entry_create (_("&Copy"), CK_Copy)); - entries = g_list_append (entries, menu_entry_create (_("C&hmod"), CK_ChangeMode)); - entries = g_list_append (entries, menu_entry_create (_("&Link"), CK_Link)); - entries = g_list_append (entries, menu_entry_create (_("&Symlink"), CK_LinkSymbolic)); + entries = g_list_prepend (entries, menu_entry_create (_("&View"), CK_View)); + entries = g_list_prepend (entries, menu_entry_create (_("Vie&w file..."), CK_ViewFile)); + entries = g_list_prepend (entries, menu_entry_create (_("&Filtered view"), CK_ViewFiltered)); + entries = g_list_prepend (entries, menu_entry_create (_("&Edit"), CK_Edit)); + entries = g_list_prepend (entries, menu_entry_create (_("&Copy"), CK_Copy)); + entries = g_list_prepend (entries, menu_entry_create (_("C&hmod"), CK_ChangeMode)); + entries = g_list_prepend (entries, menu_entry_create (_("&Link"), CK_Link)); + entries = g_list_prepend (entries, menu_entry_create (_("&Symlink"), CK_LinkSymbolic)); entries = - g_list_append (entries, - menu_entry_create (_("Relative symlin&k"), CK_LinkSymbolicRelative)); - entries = g_list_append (entries, menu_entry_create (_("Edit s&ymlink"), CK_LinkSymbolicEdit)); - entries = g_list_append (entries, menu_entry_create (_("Ch&own"), CK_ChangeOwn)); + g_list_prepend (entries, + menu_entry_create (_("Relative symlin&k"), CK_LinkSymbolicRelative)); + entries = g_list_prepend (entries, menu_entry_create (_("Edit s&ymlink"), CK_LinkSymbolicEdit)); + entries = g_list_prepend (entries, menu_entry_create (_("Ch&own"), CK_ChangeOwn)); entries = - g_list_append (entries, menu_entry_create (_("&Advanced chown"), CK_ChangeOwnAdvanced)); - entries = g_list_append (entries, menu_entry_create (_("&Rename/Move"), CK_Move)); - entries = g_list_append (entries, menu_entry_create (_("&Mkdir"), CK_MakeDir)); - entries = g_list_append (entries, menu_entry_create (_("&Delete"), CK_Delete)); - entries = g_list_append (entries, menu_entry_create (_("&Quick cd"), CK_CdQuick)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Select &group"), CK_Select)); - entries = g_list_append (entries, menu_entry_create (_("U&nselect group"), CK_Unselect)); - entries = g_list_append (entries, menu_entry_create (_("&Invert selection"), CK_SelectInvert)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("E&xit"), CK_Quit)); - - return entries; + g_list_prepend (entries, menu_entry_create (_("&Advanced chown"), CK_ChangeOwnAdvanced)); + entries = g_list_prepend (entries, menu_entry_create (_("&Rename/Move"), CK_Move)); + entries = g_list_prepend (entries, menu_entry_create (_("&Mkdir"), CK_MakeDir)); + entries = g_list_prepend (entries, menu_entry_create (_("&Delete"), CK_Delete)); + entries = g_list_prepend (entries, menu_entry_create (_("&Quick cd"), CK_CdQuick)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("Select &group"), CK_Select)); + entries = g_list_prepend (entries, menu_entry_create (_("U&nselect group"), CK_Unselect)); + entries = g_list_prepend (entries, menu_entry_create (_("&Invert selection"), CK_SelectInvert)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("E&xit"), CK_Quit)); + + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -265,51 +265,51 @@ create_command_menu (void) */ GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&User menu"), CK_UserMenu)); - entries = g_list_append (entries, menu_entry_create (_("&Directory tree"), CK_Tree)); - entries = g_list_append (entries, menu_entry_create (_("&Find file"), CK_Find)); - entries = g_list_append (entries, menu_entry_create (_("S&wap panels"), CK_Swap)); - entries = g_list_append (entries, menu_entry_create (_("Switch &panels on/off"), CK_Shell)); + entries = g_list_prepend (entries, menu_entry_create (_("&User menu"), CK_UserMenu)); + entries = g_list_prepend (entries, menu_entry_create (_("&Directory tree"), CK_Tree)); + entries = g_list_prepend (entries, menu_entry_create (_("&Find file"), CK_Find)); + entries = g_list_prepend (entries, menu_entry_create (_("S&wap panels"), CK_Swap)); + entries = g_list_prepend (entries, menu_entry_create (_("Switch &panels on/off"), CK_Shell)); entries = - g_list_append (entries, menu_entry_create (_("&Compare directories"), CK_CompareDirs)); + g_list_prepend (entries, menu_entry_create (_("&Compare directories"), CK_CompareDirs)); #ifdef USE_DIFF_VIEW - entries = g_list_append (entries, menu_entry_create (_("C&ompare files"), CK_CompareFiles)); + entries = g_list_prepend (entries, menu_entry_create (_("C&ompare files"), CK_CompareFiles)); #endif entries = - g_list_append (entries, menu_entry_create (_("E&xternal panelize"), CK_ExternalPanelize)); - entries = g_list_append (entries, menu_entry_create (_("Show directory s&izes"), CK_DirSize)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Command &history"), CK_History)); - entries = g_list_append (entries, menu_entry_create (_("Di&rectory hotlist"), CK_HotList)); + g_list_prepend (entries, menu_entry_create (_("E&xternal panelize"), CK_ExternalPanelize)); + entries = g_list_prepend (entries, menu_entry_create (_("Show directory s&izes"), CK_DirSize)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("Command &history"), CK_History)); + entries = g_list_prepend (entries, menu_entry_create (_("Di&rectory hotlist"), CK_HotList)); #ifdef ENABLE_VFS - entries = g_list_append (entries, menu_entry_create (_("&Active VFS list"), CK_VfsList)); + entries = g_list_prepend (entries, menu_entry_create (_("&Active VFS list"), CK_VfsList)); #endif #ifdef WITH_BACKGROUND - entries = g_list_append (entries, menu_entry_create (_("&Background jobs"), CK_Jobs)); + entries = g_list_prepend (entries, menu_entry_create (_("&Background jobs"), CK_Jobs)); #endif - entries = g_list_append (entries, menu_entry_create (_("Screen lis&t"), CK_ScreenList)); - entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("Screen lis&t"), CK_ScreenList)); + entries = g_list_prepend (entries, menu_separator_create ()); #ifdef ENABLE_VFS_UNDELFS entries = - g_list_append (entries, - menu_entry_create (_("&Undelete files (ext2fs only)"), CK_Undelete)); + g_list_prepend (entries, + menu_entry_create (_("&Undelete files (ext2fs only)"), CK_Undelete)); #endif #ifdef LISTMODE_EDITOR - entries = g_list_append (entries, menu_entry_create (_("&Listing format edit"), CK_ListMode)); + entries = g_list_prepend (entries, menu_entry_create (_("&Listing format edit"), CK_ListMode)); #endif #if defined (ENABLE_VFS_UNDELFS) || defined (LISTMODE_EDITOR) - entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_separator_create ()); #endif entries = - g_list_append (entries, - menu_entry_create (_("Edit &extension file"), CK_EditExtensionsFile)); - entries = g_list_append (entries, menu_entry_create (_("Edit &menu file"), CK_EditUserMenu)); + g_list_prepend (entries, + menu_entry_create (_("Edit &extension file"), CK_EditExtensionsFile)); + entries = g_list_prepend (entries, menu_entry_create (_("Edit &menu file"), CK_EditUserMenu)); entries = - g_list_append (entries, - menu_entry_create (_("Edit hi&ghlighting group file"), - CK_EditFileHighlightFile)); + g_list_prepend (entries, + menu_entry_create (_("Edit hi&ghlighting group file"), + CK_EditFileHighlightFile)); - return entries; + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ @@ -319,20 +319,21 @@ create_options_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Configuration..."), CK_Options)); - entries = g_list_append (entries, menu_entry_create (_("&Layout..."), CK_OptionsLayout)); - entries = g_list_append (entries, menu_entry_create (_("&Panel options..."), CK_OptionsPanel)); - entries = g_list_append (entries, menu_entry_create (_("C&onfirmation..."), CK_OptionsConfirm)); + entries = g_list_prepend (entries, menu_entry_create (_("&Configuration..."), CK_Options)); + entries = g_list_prepend (entries, menu_entry_create (_("&Layout..."), CK_OptionsLayout)); + entries = g_list_prepend (entries, menu_entry_create (_("&Panel options..."), CK_OptionsPanel)); entries = - g_list_append (entries, menu_entry_create (_("&Display bits..."), CK_OptionsDisplayBits)); - entries = g_list_append (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys)); + g_list_prepend (entries, menu_entry_create (_("C&onfirmation..."), CK_OptionsConfirm)); + entries = + g_list_prepend (entries, menu_entry_create (_("&Display bits..."), CK_OptionsDisplayBits)); + entries = g_list_prepend (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys)); #ifdef ENABLE_VFS - entries = g_list_append (entries, menu_entry_create (_("&Virtual FS..."), CK_OptionsVfs)); + entries = g_list_prepend (entries, menu_entry_create (_("&Virtual FS..."), CK_OptionsVfs)); #endif - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup)); + entries = g_list_prepend (entries, menu_separator_create ()); + entries = g_list_prepend (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup)); - return entries; + return g_list_reverse (entries); } /* --------------------------------------------------------------------------------------------- */ -- 2.11.4.GIT