blob: 13fcba466e7439b07849104fa8af3c841c8972c4 (
plain)
1 From 799e206b6780ee6bab2bb56debf8412dca0346f5 Mon Sep 17 00:00:00 2001
2 From: Nick Schermer <nick@xfce.org>
3 Date: Thu, 20 Jan 2011 10:31:10 +0000
4 Subject: Also try the garcon install sysconfigdir for config lookups.
5
6 Hard-code the $(sysconfdir)/xdg path in garcon_config_lookup(),
7 so the chance we find xfce-applications.menu is higher on
8 systems that do not have XDG_CONFIG_DIRS setup properly.
9 ---
10 diff --git a/garcon/Makefile.am b/garcon/Makefile.am
11 index b524b38..3ba0b19 100644
12 --- a/garcon/Makefile.am
13 +++ b/garcon/Makefile.am
14 @@ -22,6 +22,7 @@ INCLUDES = \
15 -DGARCON_COMPILATION \
16 -DGARCON_VERSION_API=\"$(GARCON_VERSION_API)\" \
17 -DG_LOG_DOMAIN=\"garcon\" \
18 + -DSYSCONFIGDIR=\"$(sysconfdir)/xdg\" \
19 $(PLATFORM_CFLAGS)
20
21 lib_LTLIBRARIES = \
22 diff --git a/garcon/garcon-config.c b/garcon/garcon-config.c
23 index a6917ee..9f69f58 100644
24 --- a/garcon/garcon-config.c
25 +++ b/garcon/garcon-config.c
26 @@ -169,7 +169,7 @@ garcon_config_lookup (const gchar *filename)
27 path = g_build_filename (g_get_user_config_dir (), filename, NULL);
28 if (g_path_is_absolute (path) && g_file_test (path, G_FILE_TEST_IS_REGULAR))
29 return path;
30 -
31 +
32 g_free (path);
33 path = NULL;
34
35 @@ -186,6 +186,15 @@ garcon_config_lookup (const gchar *filename)
36 }
37 }
38
39 + /* Also try the install prefix of garcon in case XDG_CONFIG_DIRS is not
40 + * properly set (startxfce4 for exaple should take care of that) */
41 + path = g_build_filename (SYSCONFIGDIR, filename, NULL);
42 + if (g_path_is_absolute (path) && g_file_test (path, G_FILE_TEST_IS_REGULAR))
43 + return path;
44 +
45 + g_free (path);
46 + path = NULL;
47 +
48 /* Return the path or NULL if the file could not be found */
49 return path;
50 }
51 --
52 cgit v0.8.3.4
|