diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Makefile.am | 3 | ||||
-rw-r--r-- | common/configuration.c | 19 |
2 files changed, 19 insertions, 3 deletions
diff --git a/common/Makefile.am b/common/Makefile.am index b501f221..4c7603c5 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -15,8 +15,7 @@ libcommon_la_SOURCES = \ libcommon_la_CFLAGS = \ $(WARN_CFLAGS) \ $(GLIB_CFLAGS) \ - -DCONFIG_DIR=\"$(sysconfdir)/lightdm\" \ - -DSYSTEM_CONFIG_DIR=\"$(pkgdatadir)/lightdm.conf.d\" + -DCONFIG_DIR=\"$(sysconfdir)/lightdm\" libcommon_la_LIBADD = \ $(GLIB_LDFLAGS) diff --git a/common/configuration.c b/common/configuration.c index 015d2fc4..524b33f4 100644 --- a/common/configuration.c +++ b/common/configuration.c @@ -140,6 +140,21 @@ load_config_directory (const gchar *path, GList **messages) g_list_free_full (files, g_free); } +static void +load_config_directories (const gchar * const *dirs, GList **messages) +{ + gint i; + + for (i = 0; dirs[i]; i++) + { + gchar *full_dir = g_build_filename (dirs[i], "lightdm", "lightdm.conf.d", NULL); + if (messages) + *messages = g_list_append (*messages, g_strdup_printf ("Loading configuration dirs from %s", full_dir)); + load_config_directory (full_dir, messages); + g_free (full_dir); + } +} + gboolean config_load_from_standard_locations (Configuration *config, const gchar *config_path, GList **messages) { @@ -148,6 +163,9 @@ config_load_from_standard_locations (Configuration *config, const gchar *config_ gboolean success = TRUE; GError *error = NULL; + load_config_directories (g_get_system_data_dirs (), messages); + load_config_directories (g_get_system_config_dirs (), messages); + if (config_path) { config_dir = g_path_get_basename (config_path); @@ -163,7 +181,6 @@ config_load_from_standard_locations (Configuration *config, const gchar *config_ config_set_string (config, "LightDM", "config-directory", config_dir); g_free (config_dir); - load_config_directory (SYSTEM_CONFIG_DIR, messages); if (config_d_dir) load_config_directory (config_d_dir, messages); g_free (config_d_dir); |