g_free (path);
}
-static gchar*
-get_config_section (const gchar *seat_name)
+static GList*
+get_config_sections (const gchar *seat_name)
{
gchar **groups, **i;
- gchar *config_section = NULL;
+ GList *config_sections = NULL;
groups = config_get_groups (config_get_instance ());
- for (i = groups; !config_section && *i; i++)
+ for (i = groups; *i; i++)
{
if (g_str_has_prefix (*i, "Seat:"))
{
const gchar *seat_name_glob = *i + strlen ("Seat:");
if (g_pattern_match_simple (seat_name_glob, seat_name))
- {
- config_section = g_strdup (*i);
- break;
- }
+ config_sections = g_list_append (config_sections, g_strdup (*i));
}
}
g_strfreev (groups);
- return config_section;
+ return config_sections;
}
static void
if (next_seat)
{
- gchar *config_section;
+ GList *config_sections, *link;
- config_section = get_config_section (seat_get_name (seat));
- set_seat_properties (next_seat, config_section);
- g_free (config_section);
+ config_sections = get_config_sections (seat_get_name (seat));
+ for (link = config_sections; link; link = link->next)
+ set_seat_properties (next_seat, (gchar*) link->data);
+ g_list_free_full (config_sections, g_free);
// We set this manually on default seat. Let's port it over if needed.
if (seat_get_boolean_property (seat, "exit-on-failure"))
{
const gchar *seat_name = login1_seat_get_id (login1_seat);
gchar **types = NULL, **type;
- gchar *config_section;
+ GList *config_sections = NULL, *link;
Seat *seat = NULL;
gboolean is_seat0, started = FALSE;
g_debug ("New seat added from logind: %s", seat_name);
is_seat0 = strcmp (seat_name, "seat0") == 0;
- config_section = get_config_section (seat_name);
- if (config_section)
+ config_sections = get_config_sections (seat_name);
+ for (link = config_sections; link; link = link->next)
{
+ gchar *config_section = link->data;
g_debug ("Loading properties from config section %s", config_section);
types = config_get_string_list (config_get_instance (), config_section, "type");
}
seat_set_property (seat, "allow-user-switching", "false");
}
- if (config_section)
- set_seat_properties (seat, config_section);
+ for (link = config_sections; link; link = link->next)
+ set_seat_properties (seat, (gchar*) link->data);
if (is_seat0)
seat_set_property (seat, "exit-on-failure", "true");
g_debug ("Failed to start seat: %s", seat_name);
}
- g_free (config_section);
+ g_list_free_full (config_sections, g_free);
g_object_unref (seat);
return started;