summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-08-05 16:37:01 +1200
committerRobert Ancell <robert.ancell@canonical.com>2015-08-05 16:37:01 +1200
commit61cc963349a67fa45407e11f82e763314f4bfd20 (patch)
treeca70892cd36c9aedba9f69dc6ab3c45fb37fa054 /common
parentad73a651581655b53225c84b6c40a6dc909e20b6 (diff)
downloadlightdm-61cc963349a67fa45407e11f82e763314f4bfd20.tar.gz
Ensure configuration file warning get in the log, not stderr
Diffstat (limited to 'common')
-rw-r--r--common/configuration.c9
-rw-r--r--common/configuration.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/common/configuration.c b/common/configuration.c
index c150d868..250d052b 100644
--- a/common/configuration.c
+++ b/common/configuration.c
@@ -34,7 +34,7 @@ config_get_instance (void)
}
gboolean
-config_load_from_file (Configuration *config, const gchar *path, GError **error)
+config_load_from_file (Configuration *config, const gchar *path, GList **messages, GError **error)
{
GKeyFile *key_file;
gchar *source_path, **groups;
@@ -60,7 +60,8 @@ config_load_from_file (Configuration *config, const gchar *path, GError **error)
group = groups[i];
if (strcmp (group, "SeatDefaults") == 0)
{
- g_printerr ("Configuration file %s contains a deprecated [SeatDefaults] section, use [Seat:*] instead\n", path);
+ if (messages)
+ *messages = g_list_append (*messages, g_strdup (" [SeatDefaults] is now called [Seat:*], please update this configuration"));
group = "Seat:*";
}
@@ -145,7 +146,7 @@ load_config_directory (const gchar *path, GList **messages)
{
if (messages)
*messages = g_list_append (*messages, g_strdup_printf ("Loading configuration from %s", conf_path));
- config_load_from_file (config_get_instance (), conf_path, &error);
+ config_load_from_file (config_get_instance (), conf_path, messages, &error);
if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
g_printerr ("Failed to load configuration from %s: %s\n", filename, error->message);
g_clear_error (&error);
@@ -202,7 +203,7 @@ config_load_from_standard_locations (Configuration *config, const gchar *config_
if (messages)
*messages = g_list_append (*messages, g_strdup_printf ("Loading configuration from %s", path));
- if (!config_load_from_file (config, path, &error))
+ if (!config_load_from_file (config, path, messages, &error))
{
gboolean is_empty;
diff --git a/common/configuration.h b/common/configuration.h
index 5f3004cc..56005eff 100644
--- a/common/configuration.h
+++ b/common/configuration.h
@@ -36,7 +36,7 @@ GType config_get_type (void);
Configuration *config_get_instance (void);
-gboolean config_load_from_file (Configuration *config, const gchar *path, GError **error);
+gboolean config_load_from_file (Configuration *config, const gchar *path, GList **messages, GError **error);
gboolean config_load_from_standard_locations (Configuration *config, const gchar *config_path, GList **messages);