diff options
author | Dan Williams <dcbw@redhat.com> | 2012-10-22 12:36:09 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-10-29 15:12:58 -0500 |
commit | 38e3819b4ee9b68e877e0452875ab6d5cbcfdff5 (patch) | |
tree | b4bf46e86c57a47c0232226be8aea025264a1d02 /libnm-util/nm-setting-ip6-config.c | |
parent | 1277f9986c83594faba4dd305678a27db1c7c9d1 (diff) | |
download | NetworkManager-38e3819b4ee9b68e877e0452875ab6d5cbcfdff5.tar.gz |
libnm-util: clean up setting registration
Make setting type registration less icky; instead of having the
connection register all the settings, have the settings themselves
register that information at library load time. Putting this sort
of thing in G_DEFINE_TYPE_WITH_CODE is apparently more standard
than the home-rolled stuff we had before. Also document the
priority stuff so when adding new settings, people know what
priority to use.
(cleanups by jklimes)
Diffstat (limited to 'libnm-util/nm-setting-ip6-config.c')
-rw-r--r-- | libnm-util/nm-setting-ip6-config.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index c6a84f8e17..aa95f577e4 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -30,6 +30,7 @@ #include "nm-utils.h" #include "nm-dbus-glib-types.h" #include "nm-glib-compat.h" +#include "nm-setting-private.h" /** * SECTION:nm-setting-ip6-config @@ -60,7 +61,12 @@ nm_setting_ip6_config_error_quark (void) G_DEFINE_BOXED_TYPE (NMIP6Address, nm_ip6_address, nm_ip6_address_dup, nm_ip6_address_unref) G_DEFINE_BOXED_TYPE (NMIP6Route, nm_ip6_route, nm_ip6_route_dup, nm_ip6_route_unref) -G_DEFINE_TYPE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING) +G_DEFINE_TYPE_WITH_CODE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING, + _nm_register_setting (NM_SETTING_IP6_CONFIG_SETTING_NAME, + g_define_type_id, + 4, + NM_SETTING_IP6_CONFIG_ERROR)) +NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP6_CONFIG) #define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate)) |