[Xfce4-commits] <garcon:master> Respect XDG priorities when returning the menu file (Bug #7470)

Nick Schermer noreply at xfce.org
Sat Apr 16 12:02:01 CEST 2011


Updating branch refs/heads/master
         to 62ec543886a724d1956bacf0887e0faa2ec011e3 (commit)
       from 62235e6787cc3f43e01987773610909d938c2de4 (commit)

commit 62ec543886a724d1956bacf0887e0faa2ec011e3
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date:   Thu Apr 7 10:12:18 2011 +0200

    Respect XDG priorities when returning the menu file (Bug #7470)
    
    799e206b introduced a fallback that is supposed to try
    SYSCONFIGDIR/menus/xfce-applications.menu when no menu file was found in
    $XDG_CONFIG_DIRS. However, this doesn't work as expected, as
    SYSCONFIGDIR/menus/xfce-applications.menu is always returned instead, and
    overrides any menu in $XDG_CONFIG_DIRS.

 garcon/garcon-config.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/garcon/garcon-config.c b/garcon/garcon-config.c
index 9f69f58..9f0c789 100644
--- a/garcon/garcon-config.c
+++ b/garcon/garcon-config.c
@@ -179,11 +179,11 @@ garcon_config_lookup (const gchar *filename)
     {
       /* Build the filename, if the file exists return the path */
       path = g_build_filename (dirs[i], filename, NULL);
-      if (!g_path_is_absolute (path) || !g_file_test (path, G_FILE_TEST_IS_REGULAR))
-        {
-          g_free (path);
-          path = NULL;
-        }
+      if (g_path_is_absolute (path) && g_file_test (path, G_FILE_TEST_IS_REGULAR))
+        return path;
+
+      g_free (path);
+      path = NULL;
     }
 
   /* Also try the install prefix of garcon in case XDG_CONFIG_DIRS is not



More information about the Xfce4-commits mailing list