diff options
author | Thomas Haller <thaller@redhat.com> | 2013-11-28 11:37:40 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2013-12-12 21:47:13 +0100 |
commit | 9d319e6da0cd8ccb58c56603680cdd94d88bd176 (patch) | |
tree | 3220a89be8d3d3c539c77e8f93948536d1d85f42 | |
parent | 844b89d497b287febe49f86b0aa65026466c26e9 (diff) | |
download | NetworkManager-9d319e6da0cd8ccb58c56603680cdd94d88bd176.tar.gz |
libnm-util: refactor NMSetting name and register_settings
- refactor register_settings to allow lookup by GType and
add the settings name to SettingInfo.
- setting NM_SETTING_NAME is deprecated and should not be set anymore.
Indeed it has always be a bug, to reset the name to a different value.
The only valid place to set the name was in the _init() function of
the derived class itself.
This is now no longer needed/possible. Instead the name get's
detected based on the registered setting types. This makes use of
the registered metadata that is available anyway since every
usable setting has to register itself.
Signed-off-by: Thomas Haller <thaller@redhat.com>
29 files changed, 85 insertions, 90 deletions
diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c index 416d68672e..fcccca90f4 100644 --- a/libnm-util/nm-setting-8021x.c +++ b/libnm-util/nm-setting-8021x.c @@ -2639,7 +2639,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_802_1x_init (NMSetting8021x *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_802_1X_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c index 8095b52d74..50b0b225af 100644 --- a/libnm-util/nm-setting-adsl.c +++ b/libnm-util/nm-setting-adsl.c @@ -276,7 +276,6 @@ need_secrets (NMSetting *setting) static void nm_setting_adsl_init (NMSettingAdsl *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_ADSL_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c index 874effcf3a..d568c01e36 100644 --- a/libnm-util/nm-setting-bluetooth.c +++ b/libnm-util/nm-setting-bluetooth.c @@ -201,7 +201,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_bluetooth_init (NMSettingBluetooth *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_BLUETOOTH_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c index 426dfe03df..720ad9382b 100644 --- a/libnm-util/nm-setting-bond.c +++ b/libnm-util/nm-setting-bond.c @@ -704,9 +704,6 @@ nm_setting_bond_init (NMSettingBond *setting) { NMSettingBondPrivate *priv = NM_SETTING_BOND_GET_PRIVATE (setting); - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_BOND_SETTING_NAME, - NULL); - priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); /* Default values: */ diff --git a/libnm-util/nm-setting-bridge-port.c b/libnm-util/nm-setting-bridge-port.c index 214e9d3cfb..0a82fa692b 100644 --- a/libnm-util/nm-setting-bridge-port.c +++ b/libnm-util/nm-setting-bridge-port.c @@ -195,7 +195,6 @@ nm_setting_bridge_port_new (void) static void nm_setting_bridge_port_init (NMSettingBridgePort *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_BRIDGE_PORT_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-bridge.c b/libnm-util/nm-setting-bridge.c index 0890c45173..10c6190961 100644 --- a/libnm-util/nm-setting-bridge.c +++ b/libnm-util/nm-setting-bridge.c @@ -322,7 +322,6 @@ get_virtual_iface_name (NMSetting *setting) static void nm_setting_bridge_init (NMSettingBridge *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_BRIDGE_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c index 4ab0e167b7..8b4752d146 100644 --- a/libnm-util/nm-setting-cdma.c +++ b/libnm-util/nm-setting-cdma.c @@ -215,7 +215,6 @@ need_secrets (NMSetting *setting) static void nm_setting_cdma_init (NMSettingCdma *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_CDMA_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c index 48ca028a38..de25c66a89 100644 --- a/libnm-util/nm-setting-connection.c +++ b/libnm-util/nm-setting-connection.c @@ -840,7 +840,6 @@ compare_property (NMSetting *setting, static void nm_setting_connection_init (NMSettingConnection *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_CONNECTION_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-dcb.c b/libnm-util/nm-setting-dcb.c index 7414972c62..6723f58d60 100644 --- a/libnm-util/nm-setting-dcb.c +++ b/libnm-util/nm-setting-dcb.c @@ -802,7 +802,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_dcb_init (NMSettingDcb *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_DCB_SETTING_NAME, NULL); } static inline void diff --git a/libnm-util/nm-setting-generic.c b/libnm-util/nm-setting-generic.c index c59fda41c4..e32ae4971f 100644 --- a/libnm-util/nm-setting-generic.c +++ b/libnm-util/nm-setting-generic.c @@ -91,7 +91,6 @@ nm_setting_generic_new (void) static void nm_setting_generic_init (NMSettingGeneric *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_GENERIC_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index 4e0198198b..4e0f28dfdc 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -405,7 +405,6 @@ need_secrets (NMSetting *setting) static void nm_setting_gsm_init (NMSettingGsm *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_GSM_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-infiniband.c b/libnm-util/nm-setting-infiniband.c index 4995940239..89ae3bc5d0 100644 --- a/libnm-util/nm-setting-infiniband.c +++ b/libnm-util/nm-setting-infiniband.c @@ -255,7 +255,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_infiniband_init (NMSettingInfiniband *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_INFINIBAND_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index b019a14e5d..4c21d0fb58 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -838,7 +838,6 @@ nm_setting_ip4_config_init (NMSettingIP4Config *setting) { NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL); priv->dns = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); } diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index c4ec4d373e..41f4a0f7e5 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -759,7 +759,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_ip6_config_init (NMSettingIP6Config *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c index c98bad5432..3bff35da92 100644 --- a/libnm-util/nm-setting-olpc-mesh.c +++ b/libnm-util/nm-setting-olpc-mesh.c @@ -89,7 +89,6 @@ NMSetting *nm_setting_olpc_mesh_new (void) static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_OLPC_MESH_SETTING_NAME, NULL); } const GByteArray * diff --git a/libnm-util/nm-setting-ppp.c b/libnm-util/nm-setting-ppp.c index b924871ee6..2e939c28be 100644 --- a/libnm-util/nm-setting-ppp.c +++ b/libnm-util/nm-setting-ppp.c @@ -413,7 +413,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_ppp_init (NMSettingPPP *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_PPP_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-pppoe.c b/libnm-util/nm-setting-pppoe.c index 29dee700bb..2ea29a6e6d 100644 --- a/libnm-util/nm-setting-pppoe.c +++ b/libnm-util/nm-setting-pppoe.c @@ -206,7 +206,6 @@ need_secrets (NMSetting *setting) static void nm_setting_pppoe_init (NMSettingPPPOE *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_PPPOE_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h index a90721e93a..30b43dd8c4 100644 --- a/libnm-util/nm-setting-private.h +++ b/libnm-util/nm-setting-private.h @@ -33,6 +33,10 @@ void _nm_register_setting (const char *name, const GType type, const guint32 priority, const GQuark error_quark); + +/* Ensure, that name is a compile time constant string. Put the function name in parenthesis to suppress expansion. */ +#define _nm_register_setting(name, type, priority, error_quark) _nm_register_setting ((name ""), type, priority, error_quark) + gboolean _nm_setting_is_base_type (NMSetting *setting); GType _nm_setting_lookup_setting_type (const char *name); GType _nm_setting_lookup_setting_type_by_quark (GQuark error_quark); diff --git a/libnm-util/nm-setting-serial.c b/libnm-util/nm-setting-serial.c index 83c38c5429..2cb80c368e 100644 --- a/libnm-util/nm-setting-serial.c +++ b/libnm-util/nm-setting-serial.c @@ -179,7 +179,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_serial_init (NMSettingSerial *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_SERIAL_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-team-port.c b/libnm-util/nm-setting-team-port.c index 0b61bab871..4dd297836a 100644 --- a/libnm-util/nm-setting-team-port.c +++ b/libnm-util/nm-setting-team-port.c @@ -110,7 +110,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_team_port_init (NMSettingTeamPort *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_TEAM_PORT_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-team.c b/libnm-util/nm-setting-team.c index 06dd064108..a583b38acf 100644 --- a/libnm-util/nm-setting-team.c +++ b/libnm-util/nm-setting-team.c @@ -156,8 +156,6 @@ get_virtual_iface_name (NMSetting *setting) static void nm_setting_team_init (NMSettingTeam *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_TEAM_SETTING_NAME, - NULL); } static void diff --git a/libnm-util/nm-setting-template.c b/libnm-util/nm-setting-template.c index dc3e420c21..7944fd9b8f 100644 --- a/libnm-util/nm-setting-template.c +++ b/libnm-util/nm-setting-template.c @@ -53,7 +53,6 @@ verify (NMSetting *setting, GSList *all_settings) static void nm_setting_template_init (NMSettingTemplate *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_TEMPLATE_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c index 9ea6fc09fa..75df487ecb 100644 --- a/libnm-util/nm-setting-vlan.c +++ b/libnm-util/nm-setting-vlan.c @@ -447,7 +447,6 @@ nm_setting_vlan_clear_priorities (NMSettingVlan *setting, NMVlanPriorityMap map) static void nm_setting_vlan_init (NMSettingVlan *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_VLAN_SETTING_NAME, NULL); } static gboolean diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c index 0423b77bbd..9ded0dd402 100644 --- a/libnm-util/nm-setting-vpn.c +++ b/libnm-util/nm-setting-vpn.c @@ -694,7 +694,6 @@ nm_setting_vpn_init (NMSettingVPN *setting) { NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting); - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_VPN_SETTING_NAME, NULL); priv->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); priv->secrets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, destroy_one_secret); } diff --git a/libnm-util/nm-setting-wimax.c b/libnm-util/nm-setting-wimax.c index 22942cf887..60eb1c5a82 100644 --- a/libnm-util/nm-setting-wimax.c +++ b/libnm-util/nm-setting-wimax.c @@ -163,7 +163,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_wimax_init (NMSettingWimax *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIMAX_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index 67f0fa26eb..b9fc07df87 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -650,7 +650,6 @@ nm_setting_wired_init (NMSettingWired *setting) { NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRED_SETTING_NAME, NULL); priv->s390_options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); } diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c index 705476c9ce..1bb7693d76 100644 --- a/libnm-util/nm-setting-wireless-security.c +++ b/libnm-util/nm-setting-wireless-security.c @@ -1055,7 +1055,6 @@ set_secret_flags (NMSetting *setting, static void nm_setting_wireless_security_init (NMSettingWirelessSecurity *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c index cc4e574141..e467662977 100644 --- a/libnm-util/nm-setting-wireless.c +++ b/libnm-util/nm-setting-wireless.c @@ -811,7 +811,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) static void nm_setting_wireless_init (NMSettingWireless *setting) { - g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRELESS_SETTING_NAME, NULL); } static void diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index bd06b90090..a3484e8912 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -66,7 +66,14 @@ G_DEFINE_ABSTRACT_TYPE (NMSetting, nm_setting, G_TYPE_OBJECT) #define NM_SETTING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING, NMSettingPrivate)) typedef struct { - char *name; + const char *name; + GType type; + guint32 priority; + GQuark error_quark; +} SettingInfo; + +typedef struct { + const SettingInfo *info; } NMSettingPrivate; enum { @@ -79,21 +86,38 @@ enum { /*************************************************************/ static GHashTable *registered_settings = NULL; +static GHashTable *registered_settings_by_type = NULL; + +static gboolean +_nm_gtype_equal (gconstpointer v1, gconstpointer v2) +{ + return *((const GType *) v1) == *((const GType *) v2); +} +static guint +_nm_gtype_hash (gconstpointer v) +{ + return *((const GType *) v); +} static void __attribute__((constructor)) _ensure_registered (void) { - g_type_init (); - _nm_value_transforms_register (); - if (G_UNLIKELY (registered_settings == NULL)) + if (G_UNLIKELY (registered_settings == NULL)) { + g_type_init (); + _nm_value_transforms_register (); registered_settings = g_hash_table_new (g_str_hash, g_str_equal); + registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal); + } } -typedef struct { - GType type; - guint32 priority; - GQuark error_quark; -} SettingInfo; +#define _ensure_setting_info(self, priv) \ + G_STMT_START { \ + NMSettingPrivate *_priv_esi = (priv); \ + if (G_UNLIKELY (!_priv_esi->info)) { \ + _priv_esi->info = _nm_setting_lookup_setting_by_type (G_OBJECT_TYPE (self)); \ + g_assert (_priv_esi->info); \ + } \ + } G_STMT_END /*************************************************************/ @@ -131,14 +155,14 @@ typedef struct { * 4: IP-level stuff */ void -_nm_register_setting (const char *name, - const GType type, - const guint32 priority, - const GQuark error_quark) +(_nm_register_setting) (const char *name, + const GType type, + const guint32 priority, + const GQuark error_quark) { SettingInfo *info; - g_return_if_fail (name != NULL); + g_return_if_fail (name != NULL && *name); g_return_if_fail (type != G_TYPE_INVALID); g_return_if_fail (type != G_TYPE_NONE); g_return_if_fail (error_quark != 0); @@ -146,8 +170,14 @@ _nm_register_setting (const char *name, _ensure_registered (); - if (G_LIKELY (g_hash_table_lookup (registered_settings, name))) + if (G_LIKELY ((info = g_hash_table_lookup (registered_settings, name)))) { + g_return_if_fail (info->type == type); + g_return_if_fail (info->error_quark == error_quark); + g_return_if_fail (info->priority == priority); + g_return_if_fail (g_strcmp0 (info->name, name) == 0); return; + } + g_return_if_fail (g_hash_table_lookup (registered_settings_by_type, &type) == NULL); if (priority == 0) g_assert_cmpstr (name, ==, NM_SETTING_CONNECTION_SETTING_NAME); @@ -156,23 +186,27 @@ _nm_register_setting (const char *name, info->type = type; info->priority = priority; info->error_quark = error_quark; - g_hash_table_insert (registered_settings, (gpointer) name, info); + info->name = name; + g_hash_table_insert (registered_settings, (void *) info->name, info); + g_hash_table_insert (registered_settings_by_type, &info->type, info); +} + +static const SettingInfo * +_nm_setting_lookup_setting_by_type (GType type) +{ + _ensure_registered (); + return g_hash_table_lookup (registered_settings_by_type, &type); } static guint32 _get_setting_priority (NMSetting *setting) { - GHashTableIter iter; - SettingInfo *info; - - _ensure_registered (); + NMSettingPrivate *priv; - g_hash_table_iter_init (&iter, registered_settings); - while (g_hash_table_iter_next (&iter, NULL, (gpointer) &info)) { - if (G_OBJECT_TYPE (setting) == info->type) - return info->priority; - } - return G_MAXUINT32; + g_return_val_if_fail (NM_IS_SETTING (setting), G_MAXUINT32); + priv = NM_SETTING_GET_PRIVATE (setting); + _ensure_setting_info (setting, priv); + return priv->info->priority; } gboolean @@ -387,7 +421,7 @@ duplicate_setting (NMSetting *setting, GParamFlags flags, gpointer user_data) { - if (flags & G_PARAM_WRITABLE) + if ((flags & (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)) == G_PARAM_WRITABLE) g_object_set_property (G_OBJECT (user_data), name, value); } @@ -450,9 +484,12 @@ nm_setting_find_in_list (GSList *settings_list, const char * nm_setting_get_name (NMSetting *setting) { - g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + NMSettingPrivate *priv; - return NM_SETTING_GET_PRIVATE (setting)->name; + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + priv = NM_SETTING_GET_PRIVATE (setting); + _ensure_setting_info (setting, priv); + return priv->info->name; } /** @@ -473,8 +510,7 @@ gboolean nm_setting_verify (NMSetting *setting, GSList *all_settings, GError **error) { g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); - if (error) - g_return_val_if_fail (*error == NULL, FALSE); + g_return_val_if_fail (!error || *error == NULL, FALSE); if (NM_SETTING_GET_CLASS (setting)->verify) return NM_SETTING_GET_CLASS (setting)->verify (setting, all_settings, error); @@ -1167,48 +1203,34 @@ nm_setting_init (NMSetting *setting) static GObject* constructor (GType type, - guint n_construct_params, - GObjectConstructParam *construct_params) + guint n_construct_params, + GObjectConstructParam *construct_params) { GObject *object; - NMSettingPrivate *priv; object = G_OBJECT_CLASS (nm_setting_parent_class)->constructor (type, - n_construct_params, - construct_params); - if (!object) - return NULL; - - priv = NM_SETTING_GET_PRIVATE (object); - if (!priv->name) { - g_warning ("Setting name is not set."); - g_object_unref (object); - object = NULL; - } + n_construct_params, + construct_params); + _ensure_setting_info (object, NM_SETTING_GET_PRIVATE (object)); return object; } static void -finalize (GObject *object) -{ - NMSettingPrivate *priv = NM_SETTING_GET_PRIVATE (object); - - g_free (priv->name); - - G_OBJECT_CLASS (nm_setting_parent_class)->finalize (object); -} - -static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { NMSettingPrivate *priv = NM_SETTING_GET_PRIVATE (object); switch (prop_id) { case PROP_NAME: - g_free (priv->name); - priv->name = g_value_dup_string (value); + /* The setter for NAME is deprecated and should not be used anymore. + * Keep the setter for NAME to remain backward compatible. + * Only assert that the caller does not try to set the name to a different value + * then the registered name, which would be extra wrong. + **/ + _ensure_setting_info (object, priv); + g_return_if_fail (!g_strcmp0 (priv->info->name, g_value_get_string (value))); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -1218,7 +1240,7 @@ set_property (GObject *object, guint prop_id, static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMSetting *setting = NM_SETTING (object); @@ -1243,7 +1265,6 @@ nm_setting_class_init (NMSettingClass *setting_class) object_class->constructor = constructor; object_class->set_property = set_property; object_class->get_property = get_property; - object_class->finalize = finalize; setting_class->update_one_secret = update_one_secret; setting_class->get_secret_flags = get_secret_flags; |