diff options
author | Thomas Haller <thaller@redhat.com> | 2021-06-18 16:48:12 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-06-23 12:47:34 +0200 |
commit | d5c4378cdf732a75862e81c8c85c23012cf080b2 (patch) | |
tree | 164124b6a4fd4f77537eef14079a5defb72e8d89 /src | |
parent | acc3a66bf2ef60458b87e9965f89b26d2e35e480 (diff) |
libnm: use new including_default flag and boolean getter for "ethernet.auto-negotiate" property
Diffstat (limited to 'src')
-rw-r--r-- | src/libnm-core-impl/nm-setting-wired.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c index 99909bf06a..c325413b22 100644 --- a/src/libnm-core-impl/nm-setting-wired.c +++ b/src/libnm-core-impl/nm-setting-wired.c @@ -995,17 +995,6 @@ compare_property(const NMSettInfoSetting *sett_info, ->compare_property(sett_info, property_idx, con_a, set_a, con_b, set_b, flags); } -static GVariant * -_override_autoneg_get(const NMSettInfoSetting * sett_info, - guint property_idx, - NMConnection * connection, - NMSetting * setting, - NMConnectionSerializationFlags flags, - const NMConnectionSerializationOptions *options) -{ - return g_variant_new_boolean(nm_setting_wired_get_auto_negotiate((NMSettingWired *) setting)); -} - /*****************************************************************************/ static void @@ -1389,17 +1378,14 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass) * "speed" and "duplex" parameters (skips link configuration). * ---end--- */ - obj_properties[PROP_AUTO_NEGOTIATE] = - g_param_spec_boolean(NM_SETTING_WIRED_AUTO_NEGOTIATE, - "", - "", - FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - _nm_properties_override_gobj( - properties_override, - obj_properties[PROP_AUTO_NEGOTIATE], - NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_BOOLEAN, - .to_dbus_fcn = _override_autoneg_get, )); + _nm_setting_property_define_boolean(properties_override, + obj_properties, + NM_SETTING_WIRED_AUTO_NEGOTIATE, + PROP_AUTO_NEGOTIATE, + FALSE, + NM_SETTING_PARAM_NONE, + nm_setting_wired_get_auto_negotiate, + .to_dbus_data.including_default = TRUE); /** * NMSettingWired:mac-address: |