[Xfce4-commits] <garcon:master> Do not sort the menu items twice with merge-all.

Nick Schermer noreply at xfce.org
Tue Jun 28 23:26:01 CEST 2011


Updating branch refs/heads/master
         to 5ad8363be883a649c98ac351e9c0d1d8de13d9a9 (commit)
       from ba62f4e94bc79e63c0ef515b0d746077258affe2 (commit)

commit 5ad8363be883a649c98ac351e9c0d1d8de13d9a9
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Jun 28 23:25:03 2011 +0200

    Do not sort the menu items twice with merge-all.
    
    The _get_items and _get_menus functions both returned sorted
    lists that were sorted again after concat, avoid this by
    directly collecting the unsorted data in _get_elements.

 garcon/garcon-menu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/garcon/garcon-menu.c b/garcon/garcon-menu.c
index f19d9b4..7e4c66e 100644
--- a/garcon/garcon-menu.c
+++ b/garcon/garcon-menu.c
@@ -1583,10 +1583,11 @@ garcon_menu_get_elements (GarconMenu *menu)
           if (merge_type == GARCON_MENU_LAYOUT_MERGE_ALL)
             {
               /* Get all menu items of this menu */
-              menu_items = garcon_menu_get_items (menu);
+              menu_items = NULL;
+              garcon_menu_item_pool_foreach (menu->priv->pool, (GHFunc) items_collect, &menu_items);
 
               /* Append submenus */
-              menu_items = g_list_concat (menu_items, garcon_menu_get_menus (menu));
+              menu_items = g_list_concat (menu_items, g_list_copy (menu->priv->submenus));
 
               /* Sort menu items */
               menu_items = g_list_sort (menu_items, (GCompareFunc) garcon_menu_compare_items);



More information about the Xfce4-commits mailing list