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-bluetooth.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-bluetooth.c')
-rw-r--r-- | libnm-util/nm-setting-bluetooth.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c index a74e55a021..161b371524 100644 --- a/libnm-util/nm-setting-bluetooth.c +++ b/libnm-util/nm-setting-bluetooth.c @@ -32,6 +32,7 @@ #include "nm-setting-bluetooth.h" #include "nm-setting-cdma.h" #include "nm-setting-gsm.h" +#include "nm-setting-private.h" /** * SECTION:nm-setting-bluetooth @@ -62,7 +63,12 @@ nm_setting_bluetooth_error_quark (void) } -G_DEFINE_TYPE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING) +G_DEFINE_TYPE_WITH_CODE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING, + _nm_register_setting (NM_SETTING_BLUETOOTH_SETTING_NAME, + g_define_type_id, + 1, + NM_SETTING_BLUETOOTH_ERROR)) +NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BLUETOOTH) #define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate)) |