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.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.c')
-rw-r--r-- | libnm-core/nm-setting.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index 0feaa87fb7..369b116c95 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -67,12 +67,9 @@ typedef struct { NMSettingPriority priority; } SettingInfo; -enum { - PROP_0, +NM_GOBJECT_PROPERTIES_DEFINE_BASE ( PROP_NAME, - - PROP_LAST -}; +); typedef struct { GenData *gendata; @@ -2593,10 +2590,11 @@ nm_setting_class_init (NMSettingClass *setting_class) * connection. Each setting type has a name unique to that type, for * example "ppp" or "802-11-wireless" or "802-3-ethernet". **/ - g_object_class_install_property - (object_class, PROP_NAME, - g_param_spec_string (NM_SETTING_NAME, "", "", - NULL, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); + obj_properties[PROP_NAME] = + g_param_spec_string (NM_SETTING_NAME, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); } |