summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-08-05 16:48:52 +1200
committerRobert Ancell <robert.ancell@canonical.com>2015-08-05 16:48:52 +1200
commit0e92f78db54ae67c76b95bf1ce2c80fdc104d537 (patch)
treeed5c21f84a66842b9613106e32b219df9fa36a07
parent21da5d7952e4ec5ae95a42d0be0e83aa36333897 (diff)
downloadlightdm-git-0e92f78db54ae67c76b95bf1ce2c80fdc104d537.tar.gz
Warn if deprecated options logind-load-seats or xdg-seat are in configuration
-rw-r--r--common/configuration.c11
-rw-r--r--common/configuration.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/common/configuration.c b/common/configuration.c
index 1ef64490..cc939516 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;
@@ -64,6 +64,11 @@ config_load_from_file (Configuration *config, const gchar *path, GError **error)
{
gchar *value, *k;
+ if (messages && g_str_has_prefix (groups[i], "Seat:") && strcmp (keys[j], "xdg-seat") == 0)
+ *messages = g_list_append (*messages, g_strdup_printf (" [%s] contains deprecated option xdg-seat, this can be safely removed", groups[i]));
+ if (messages && strcmp (groups[i], "LightDM") == 0 && strcmp (keys[j], "logind-load-seats") == 0)
+ *messages = g_list_append (*messages, g_strdup (" [LightDM] contains deprecated option logind-load-seats, this can be safely removed"));
+
value = g_key_file_get_value (key_file, groups[i], keys[j], NULL);
g_key_file_set_value (config->priv->key_file, groups[i], keys[j], value);
g_free (value);
@@ -137,7 +142,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);
@@ -194,7 +199,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);