[Xfce4-commits] <garcon:master> Disable the parent call for getting the appdirs.

Nick Schermer nick at xfce.org
Tue Aug 18 19:38:02 CEST 2009


Updating branch refs/heads/master
         to 7042cf3c6de66dfb1fb20ac72b36b49be957462d (commit)
       from 4019f0dd48c2f4ec8320a58890730937eb455107 (commit)

commit 7042cf3c6de66dfb1fb20ac72b36b49be957462d
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Aug 18 19:36:21 2009 +0200

    Disable the parent call for getting the appdirs.
    
    A submenu always inherits the application directories of its parent,
    that is the reason the parent call was added.
    It only turned out we were looking in that same directories for
    .desktop files multiple times.
    
    This was caused by the combination of the parent call and
    traversing the children in garcon_menu_collect_files(). For each
    submenu the appdirs of the root were added and traversed again.
    
    This is not needed because we always start at the root and traverse
    in "pre-order", so all the desktop files are added in the hash-table.

 garcon/garcon-menu.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/garcon/garcon-menu.c b/garcon/garcon-menu.c
index 629d9c2..75c340f 100644
--- a/garcon/garcon-menu.c
+++ b/garcon/garcon-menu.c
@@ -813,8 +813,22 @@ garcon_menu_get_app_dirs (GarconMenu *menu)
                                                     GARCON_MENU_NODE_TYPE_APP_DIR,
                                                     TRUE);
 
+#if 0
+  /* A submenu always inherits the application directories of its parent,
+   * that is the reason the call below was added.
+   * It only turned out we were looking in that same directories for
+   * .desktop files multiple times.
+   *
+   * This was caused by the combination of the parent call below and
+   * traversing the children in garcon_menu_collect_files(). For each
+   * submenu the appdirs of the root were added and traversed again.
+   *
+   * This is not needed because we always start at the root and traverse
+   * in "pre-order", so all the desktop files are added in the hash-table.
+   */
   if (menu->priv->parent != NULL)
     dirs = g_list_concat (dirs, garcon_menu_get_app_dirs (menu->priv->parent));
+#endif
 
   return dirs;
 }



More information about the Xfce4-commits mailing list