summaryrefslogtreecommitdiff
path: root/libnm-util/nm-setting-connection.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-10-22 12:36:09 -0500
committerDan Williams <dcbw@redhat.com>2012-10-29 15:12:58 -0500
commit38e3819b4ee9b68e877e0452875ab6d5cbcfdff5 (patch)
treeb4bf46e86c57a47c0232226be8aea025264a1d02 /libnm-util/nm-setting-connection.c
parent1277f9986c83594faba4dd305678a27db1c7c9d1 (diff)
downloadNetworkManager-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-connection.c')
-rw-r--r--libnm-util/nm-setting-connection.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c
index 77aff4faef..1222f9763b 100644
--- a/libnm-util/nm-setting-connection.c
+++ b/libnm-util/nm-setting-connection.c
@@ -28,6 +28,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-param-spec-specialized.h"
#include "nm-setting-connection.h"
+#include "nm-setting-private.h"
/**
* SECTION:nm-setting-connection
@@ -58,7 +59,12 @@ nm_setting_connection_error_quark (void)
}
-G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)
+G_DEFINE_TYPE_WITH_CODE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING,
+ _nm_register_setting (NM_SETTING_CONNECTION_SETTING_NAME,
+ g_define_type_id,
+ 0,
+ NM_SETTING_CONNECTION_ERROR))
+NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_CONNECTION)
#define NM_SETTING_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate))