From bbae86d3d2997a853ca0365e8eb7a3ca7489ee09 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Fri, 25 Jan 2019 11:24:41 +0100 Subject: New upstream version 1.15.2 --- libnm-core/nm-setting-6lowpan.c | 80 ++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 36 deletions(-) (limited to 'libnm-core/nm-setting-6lowpan.c') diff --git a/libnm-core/nm-setting-6lowpan.c b/libnm-core/nm-setting-6lowpan.c index c0ce232d..3a2b084e 100644 --- a/libnm-core/nm-setting-6lowpan.c +++ b/libnm-core/nm-setting-6lowpan.c @@ -19,9 +19,20 @@ #include "nm-default.h" -#include "nm-setting-private.h" #include "nm-setting-6lowpan.h" +#include "nm-setting-private.h" + +/** + * SECTION:nm-setting-6lowpan + * @short_description: Describes connection properties for 6LoWPAN interfaces + * + * The #NMSetting6Lowpan object is a #NMSetting subclass that describes properties + * necessary for connection to 6LoWPAN interfaces. + **/ + +/*****************************************************************************/ + NM_GOBJECT_PROPERTIES_DEFINE_BASE ( PROP_PARENT, ); @@ -43,33 +54,11 @@ struct _NMSetting6LowpanClass { NMSettingClass parent; }; -/** - * SECTION:nm-setting-6lowpan - * @short_description: Describes connection properties for 6LoWPAN interfaces - * - * The #NMSetting6Lowpan object is a #NMSetting subclass that describes properties - * necessary for connection to 6LoWPAN interfaces. - **/ - G_DEFINE_TYPE (NMSetting6Lowpan, nm_setting_6lowpan, NM_TYPE_SETTING) #define NM_SETTING_6LOWPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_6LOWPAN, NMSetting6LowpanPrivate)) - -/** - * nm_setting_6lowpan_new: - * - * Creates a new #NMSetting6Lowpan object with default values. - * - * Returns: (transfer full): the new empty #NMSetting6Lowpan object - * - * Since: 1.14 - **/ -NMSetting * -nm_setting_6lowpan_new (void) -{ - return (NMSetting *) g_object_new (NM_TYPE_SETTING_6LOWPAN, NULL); -} +/*****************************************************************************/ /** * nm_setting_6lowpan_get_parent: @@ -143,22 +132,18 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return TRUE; } -static void -nm_setting_6lowpan_init (NMSetting6Lowpan *setting) -{ -} +/*****************************************************************************/ static void -set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) { NMSetting6Lowpan *setting = NM_SETTING_6LOWPAN (object); NMSetting6LowpanPrivate *priv = NM_SETTING_6LOWPAN_GET_PRIVATE (setting); switch (prop_id) { case PROP_PARENT: - g_free (priv->parent); - priv->parent = g_value_dup_string (value); + g_value_set_string (value, priv->parent); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -167,15 +152,16 @@ set_property (GObject *object, guint prop_id, } static void -get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) { NMSetting6Lowpan *setting = NM_SETTING_6LOWPAN (object); NMSetting6LowpanPrivate *priv = NM_SETTING_6LOWPAN_GET_PRIVATE (setting); switch (prop_id) { case PROP_PARENT: - g_value_set_string (value, priv->parent); + g_free (priv->parent); + priv->parent = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -183,6 +169,28 @@ get_property (GObject *object, guint prop_id, } } +/*****************************************************************************/ + +static void +nm_setting_6lowpan_init (NMSetting6Lowpan *setting) +{ +} + +/** + * nm_setting_6lowpan_new: + * + * Creates a new #NMSetting6Lowpan object with default values. + * + * Returns: (transfer full): the new empty #NMSetting6Lowpan object + * + * Since: 1.14 + **/ +NMSetting * +nm_setting_6lowpan_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_6LOWPAN, NULL); +} + static void finalize (GObject *object) { @@ -202,8 +210,8 @@ nm_setting_6lowpan_class_init (NMSetting6LowpanClass *klass) g_type_class_add_private (klass, sizeof (NMSetting6LowpanPrivate)); - object_class->set_property = set_property; object_class->get_property = get_property; + object_class->set_property = set_property; object_class->finalize = finalize; setting_class->verify = verify; -- cgit 1.3.0-6-gf8a5