summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-07-28 16:45:17 +1200
committerRobert Ancell <robert.ancell@canonical.com>2015-07-28 16:45:17 +1200
commit2db3a8b2e819ae50442688b2c75f77b6a14fbbdc (patch)
tree0175ee26ff666208045eaafc065b7075d7dc8ba6 /common
parentf9e7aba5ce81e463d16a9aa1dbf7107c67dd0ba7 (diff)
downloadlightdm-git-2db3a8b2e819ae50442688b2c75f77b6a14fbbdc.tar.gz
Internally merge the [SeatDefaults] and [Seat:*] sections together. The previous method meant configuration snippets using a mix of old and new naming would not correctly override eachother
Diffstat (limited to 'common')
-rw-r--r--common/configuration.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/common/configuration.c b/common/configuration.c
index f456faaf..c150d868 100644
--- a/common/configuration.c
+++ b/common/configuration.c
@@ -53,11 +53,16 @@ config_load_from_file (Configuration *config, const gchar *path, GError **error)
groups = g_key_file_get_groups (key_file, NULL);
for (i = 0; groups[i]; i++)
{
- gchar **keys;
+ gchar **keys, *group;
int j;
- if (strcmp (groups[i], "SeatDefaults") == 0)
+ /* Move keys from deprecated [SeatDefaults] into [Seat:*] */
+ group = groups[i];
+ if (strcmp (group, "SeatDefaults") == 0)
+ {
g_printerr ("Configuration file %s contains a deprecated [SeatDefaults] section, use [Seat:*] instead\n", path);
+ group = "Seat:*";
+ }
keys = g_key_file_get_keys (key_file, groups[i], NULL, error);
if (!keys)
@@ -68,10 +73,10 @@ config_load_from_file (Configuration *config, const gchar *path, GError **error)
gchar *value, *k;
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_key_file_set_value (config->priv->key_file, group, keys[j], value);
g_free (value);
- k = g_strdup_printf ("%s]%s", groups[i], keys[j]);
+ k = g_strdup_printf ("%s]%s", group, keys[j]);
g_hash_table_insert (config->priv->key_sources, k, source_path);
}