diff options
author | Laércio de Sousa <lbsousajr@gmail.com> | 2014-08-27 10:32:21 -0300 |
---|---|---|
committer | Laércio de Sousa <lbsousajr@gmail.com> | 2014-08-27 10:32:21 -0300 |
commit | 14b1104098ec7e4ac60e918797a29254b147f74e (patch) | |
tree | 0e93dead4161123faca8e45f951ac03433230c67 | |
parent | 61ae6303b6f1a27a3e93e9093e624d9d4b684be0 (diff) | |
download | lightdm-14b1104098ec7e4ac60e918797a29254b147f74e.tar.gz |
Move get_config_section() definition code before display_manager_seat_removed_cb() definition.
-rw-r--r-- | src/lightdm.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/lightdm.c b/src/lightdm.c index adc665f1..192440f9 100644 --- a/src/lightdm.c +++ b/src/lightdm.c @@ -145,6 +145,40 @@ log_init (void) g_free (path); } +static gchar* +get_config_section (const gchar *seat_name) +{ + gchar **groups, **i; + gchar *config_section = NULL; + + groups = config_get_groups (config_get_instance ()); + for (i = groups; !config_section && *i; i++) + { + if (g_str_has_prefix (*i, "Seat:")) + { + const gchar *seat_name_suffix = *i + strlen ("Seat:"); + gchar *seat_name_globbing; + gboolean matches; + + if (g_str_has_suffix (seat_name_suffix, "*")) + seat_name_globbing = g_strndup (seat_name_suffix, strlen (seat_name_suffix) - 1); + else + seat_name_globbing = g_strdup (seat_name_suffix); + + matches = g_str_has_prefix (seat_name, seat_name_globbing); + g_free (seat_name_globbing); + + if (matches) + { + config_section = g_strdup (*i); + break; + } + } + } + g_strfreev (groups); + return config_section; +} + static void set_seat_properties (Seat *seat, const gchar *config_section) { @@ -934,40 +968,6 @@ name_lost_cb (GDBusConnection *connection, exit (EXIT_FAILURE); } -static gchar* -get_config_section (const gchar *seat_name) -{ - gchar **groups, **i; - gchar *config_section = NULL; - - groups = config_get_groups (config_get_instance ()); - for (i = groups; !config_section && *i; i++) - { - if (g_str_has_prefix (*i, "Seat:")) - { - const gchar *seat_name_suffix = *i + strlen ("Seat:"); - gchar *seat_name_globbing; - gboolean matches; - - if (g_str_has_suffix (seat_name_suffix, "*")) - seat_name_globbing = g_strndup (seat_name_suffix, strlen (seat_name_suffix) - 1); - else - seat_name_globbing = g_strdup (seat_name_suffix); - - matches = g_str_has_prefix (seat_name, seat_name_globbing); - g_free (seat_name_globbing); - - if (matches) - { - config_section = g_strdup (*i); - break; - } - } - } - g_strfreev (groups); - return config_section; -} - static gboolean add_login1_seat (Login1Seat *login1_seat) { |