]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blobdiff - liblightdm-gobject/layout.c
Revert r2392 - it seems to have broken ABI in liblightdm-gobject
[sojka/lightdm.git] / liblightdm-gobject / layout.c
index c0426e35995036f1285b9c08dc025b5f7fd32db8..a780343a32d14aa40664443adb27977ae49cef8b 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2010 Robert Ancell.
  * Author: Robert Ancell <robert.ancell@canonical.com>
- * 
+ *
  * This library is free software; you can redistribute it and/or modify it under
  * the terms of the GNU Lesser General Public License as published by the Free
  * Software Foundation; either version 2 or version 3 of the License.
@@ -14,8 +14,7 @@
 #include "lightdm/layout.h"
 
 enum {
-    PROP_0,
-    PROP_NAME,
+    PROP_NAME = 1,
     PROP_SHORT_DESCRIPTION,
     PROP_DESCRIPTION
 };
@@ -117,7 +116,7 @@ lightdm_get_layouts (void)
     display = XOpenDisplay (NULL);
     if (display == NULL)
         return NULL;
-    
+
     xkl_engine = xkl_engine_get_instance (display);
     xkl_config = xkl_config_rec_new ();
     if (!xkl_config_rec_get_from_server (xkl_config, xkl_engine))
@@ -203,9 +202,9 @@ lightdm_get_layout (void)
 /**
  * lightdm_layout_get_name:
  * @layout: A #LightDMLayout
- * 
+ *
  * Get the name of a layout.
- * 
+ *
  * Return value: The name of the layout
  **/
 const gchar *
@@ -218,7 +217,7 @@ lightdm_layout_get_name (LightDMLayout *layout)
 /**
  * lightdm_layout_get_short_description:
  * @layout: A #LightDMLayout
- * 
+ *
  * Get the short description of a layout.
  *
  * Return value: A short description of the layout
@@ -233,9 +232,9 @@ lightdm_layout_get_short_description (LightDMLayout *layout)
 /**
  * lightdm_layout_get_description:
  * @layout: A #LightDMLayout
- * 
+ *
  * Get the long description of a layout.
- * 
+ *
  * Return value: A long description of the layout
  **/
 const gchar *
@@ -252,9 +251,9 @@ lightdm_layout_init (LightDMLayout *layout)
 
 static void
 lightdm_layout_set_property (GObject      *object,
-                         guint         prop_id,
-                         const GValue *value,
-                         GParamSpec   *pspec)
+                             guint         prop_id,
+                             const GValue *value,
+                             GParamSpec   *pspec)
 {
     LightDMLayout *self = LIGHTDM_LAYOUT (object);
     LightDMLayoutPrivate *priv = GET_PRIVATE (self);
@@ -280,9 +279,9 @@ lightdm_layout_set_property (GObject      *object,
 
 static void
 lightdm_layout_get_property (GObject    *object,
-                         guint       prop_id,
-                         GValue     *value,
-                         GParamSpec *pspec)
+                             guint       prop_id,
+                             GValue     *value,
+                             GParamSpec *pspec)
 {
     LightDMLayout *self;
 
@@ -304,15 +303,27 @@ lightdm_layout_get_property (GObject    *object,
     }
 }
 
+static void
+lightdm_layout_finalize (GObject *object)
+{
+    LightDMLayout *self = LIGHTDM_LAYOUT (object);
+    LightDMLayoutPrivate *priv = GET_PRIVATE (self);
+
+    g_free (priv->name);
+    g_free (priv->short_description);  
+    g_free (priv->description);
+}
+
 static void
 lightdm_layout_class_init (LightDMLayoutClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  
+
     g_type_class_add_private (klass, sizeof (LightDMLayoutPrivate));
 
     object_class->set_property = lightdm_layout_set_property;
     object_class->get_property = lightdm_layout_get_property;
+    object_class->finalize = lightdm_layout_finalize;
 
     g_object_class_install_property (object_class,
                                      PROP_NAME,