diff options
author | Thomas Haller <thaller@redhat.com> | 2019-01-11 08:28:26 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-01-15 09:55:24 +0100 |
commit | a3d6976efcb0b05fe304643c466df12b5ee56f9d (patch) | |
tree | 8817767526597b7f5ca6a49775e52b52c6b06371 /libnm-core/nm-setting-adsl.c | |
parent | 450a471dfed6db939c70332d37cb6761adbd6994 (diff) | |
download | NetworkManager-a3d6976efcb0b05fe304643c466df12b5ee56f9d.tar.gz |
libnm-core: cleanup NMSetting's class initialization
Unify the coding style for class-init functions in libnm-core.
Also make use of obj_properties, NM_GOBJECT_PROPERTIES_DEFINE(), and
_notify().
Diffstat (limited to 'libnm-core/nm-setting-adsl.c')
-rw-r--r-- | libnm-core/nm-setting-adsl.c | 90 |
1 files changed, 41 insertions, 49 deletions
diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c index 9ffff92783..1d6530a8e3 100644 --- a/libnm-core/nm-setting-adsl.c +++ b/libnm-core/nm-setting-adsl.c @@ -51,8 +51,7 @@ typedef struct { guint32 vci; } NMSettingAdslPrivate; -enum { - PROP_0, +NM_GOBJECT_PROPERTIES_DEFINE_BASE ( PROP_USERNAME, PROP_PASSWORD, PROP_PASSWORD_FLAGS, @@ -60,9 +59,7 @@ enum { PROP_ENCAPSULATION, PROP_VPI, PROP_VCI, - - LAST_PROP -}; +); /** * nm_setting_adsl_new: @@ -364,86 +361,81 @@ nm_setting_adsl_class_init (NMSettingAdslClass *klass) * * Username used to authenticate with the ADSL service. **/ - g_object_class_install_property - (object_class, PROP_USERNAME, - g_param_spec_string (NM_SETTING_ADSL_USERNAME, "", "", - NULL, - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_USERNAME] = + g_param_spec_string (NM_SETTING_ADSL_USERNAME, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); /** * NMSettingAdsl:password: * * Password used to authenticate with the ADSL service. **/ - g_object_class_install_property - (object_class, PROP_PASSWORD, - g_param_spec_string (NM_SETTING_ADSL_PASSWORD, "", "", - NULL, - G_PARAM_READWRITE | - NM_SETTING_PARAM_SECRET | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_PASSWORD] = + g_param_spec_string (NM_SETTING_ADSL_PASSWORD, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_SECRET | + G_PARAM_STATIC_STRINGS); /** * NMSettingAdsl:password-flags: * * Flags indicating how to handle the #NMSettingAdsl:password property. **/ - g_object_class_install_property - (object_class, PROP_PASSWORD_FLAGS, - g_param_spec_flags (NM_SETTING_ADSL_PASSWORD_FLAGS, "", "", - NM_TYPE_SETTING_SECRET_FLAGS, - NM_SETTING_SECRET_FLAG_NONE, - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_PASSWORD_FLAGS] = + g_param_spec_flags (NM_SETTING_ADSL_PASSWORD_FLAGS, "", "", + NM_TYPE_SETTING_SECRET_FLAGS, + NM_SETTING_SECRET_FLAG_NONE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); /** * NMSettingAdsl:protocol: * * ADSL connection protocol. Can be "pppoa", "pppoe" or "ipoatm". **/ - g_object_class_install_property - (object_class, PROP_PROTOCOL, - g_param_spec_string (NM_SETTING_ADSL_PROTOCOL, "", "", - NULL, - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_PROTOCOL] = + g_param_spec_string (NM_SETTING_ADSL_PROTOCOL, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); /** * NMSettingAdsl:encapsulation: * * Encapsulation of ADSL connection. Can be "vcmux" or "llc". **/ - g_object_class_install_property - (object_class, PROP_ENCAPSULATION, - g_param_spec_string (NM_SETTING_ADSL_ENCAPSULATION, "", "", - NULL, - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_ENCAPSULATION] = + g_param_spec_string (NM_SETTING_ADSL_ENCAPSULATION, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); /** * NMSettingAdsl:vpi: * * VPI of ADSL connection **/ - g_object_class_install_property - (object_class, PROP_VPI, - g_param_spec_uint (NM_SETTING_ADSL_VPI, "", "", - 0, 65536, 0, - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_VPI] = + g_param_spec_uint (NM_SETTING_ADSL_VPI, "", "", + 0, 65536, 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); /** * NMSettingAdsl:vci: * * VCI of ADSL connection **/ - g_object_class_install_property - (object_class, PROP_VCI, - g_param_spec_uint (NM_SETTING_ADSL_VCI, "", "", - 0, 65536, 0, - G_PARAM_READWRITE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_VCI] = + g_param_spec_uint (NM_SETTING_ADSL_VCI, "", "", + 0, 65536, 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); _nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_ADSL); } |