]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Move get_config_section() definition code before display_manager_seat_removed_cb...
authorLaércio de Sousa <lbsousajr@gmail.com>
Wed, 27 Aug 2014 13:32:21 +0000 (10:32 -0300)
committerLaércio de Sousa <lbsousajr@gmail.com>
Wed, 27 Aug 2014 13:32:21 +0000 (10:32 -0300)
src/lightdm.c

index adc665f1c4954645ac6298c12fe59140b2255813..192440f97a4911549cd484da5052391605876820 100644 (file)
@@ -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)
 {