return g_key_file_get_string (config->priv->key_file, section, key, NULL);
}
+void
+config_set_string_list (Configuration *config, const gchar *section, const gchar *key, const gchar **value, gsize length)
+{
+ g_key_file_set_string_list (config->priv->key_file, section, key, value, length);
+}
+
+gchar **
+config_get_string_list (Configuration *config, const gchar *section, const gchar *key)
+{
+ return g_key_file_get_string_list (config->priv->key_file, section, key, NULL, NULL);
+}
+
void
config_set_integer (Configuration *config, const gchar *section, const gchar *key, gint value)
{
gchar *config_get_string (Configuration *config, const gchar *section, const gchar *key);
+void config_set_string_list (Configuration *config, const gchar *section, const gchar *key, const gchar **value, gsize length);
+
+gchar **config_get_string_list (Configuration *config, const gchar *section, const gchar *key);
+
void config_set_integer (Configuration *config, const gchar *section, const gchar *key, gint value);
gint config_get_integer (Configuration *config, const gchar *section, const gchar *key);
for (i = groups; *i; i++)
{
gchar *config_section = *i;
- gchar *type;
- Seat *seat;
+ gchar **types;
+ gchar **type;
+ Seat *seat = NULL;
const gchar *const seatpfx = "Seat:";
if (!g_str_has_prefix (config_section, seatpfx))
continue;
g_debug ("Loading seat %s", config_section);
- type = config_get_string (config_get_instance (), config_section, "type");
- if (!type)
- type = config_get_string (config_get_instance (), "SeatDefaults", "type");
- seat = seat_new (type);
- g_free (type);
+ types = config_get_string_list (config_get_instance (), config_section, "type");
+ if (!types)
+ types = config_get_string_list (config_get_instance (), "SeatDefaults", "type");
+ for (type = types; !seat && *type; type++)
+ seat = seat_new (*type);
+ g_strfreev (types);
if (seat)
{
const gsize seatpfxlen = strlen(seatpfx);
/* If no seats start a default one */
if (n_seats == 0 && config_get_boolean (config_get_instance (), "LightDM", "start-default-seat"))
{
- gchar *type;
- Seat *seat;
+ gchar **types;
+ gchar **type;
+ Seat *seat = NULL;
g_debug ("Adding default seat");
- type = config_get_string (config_get_instance (), "SeatDefaults", "type");
- seat = seat_new (type);
- g_free (type);
+ types = config_get_string_list (config_get_instance (), "SeatDefaults", "type");
+ for (type = types; !seat && *type; type++)
+ seat = seat_new (*type);
+ g_strfreev (types);
if (seat)
{
set_seat_properties (seat, NULL);
}
else
{
- g_warning ("Failed to create default seat %s", type);
+ g_warning ("Failed to create default seat");
return EXIT_FAILURE;
}
}