libnm: drop unused NMSettInfoProperty.gprop_to_dbus_fcn() hook

This commit is contained in:
Thomas Haller 2021-06-29 22:06:37 +02:00
parent d652e0f534
commit 9a05db61d6
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 1 additions and 18 deletions

View file

@ -943,9 +943,6 @@ _nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * s
nm_assert(property_info->param_spec);
nm_assert(property_info->property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_gprop);
nm_assert(property_info->property_type->typdata_to_dbus.gprop_type
== NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT
|| !property_info->to_dbus_data.gprop_to_dbus_fcn);
g_value_init(&prop_value, property_info->param_spec->value_type);
@ -957,9 +954,6 @@ _nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * s
switch (property_info->property_type->typdata_to_dbus.gprop_type) {
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT:
if (property_info->to_dbus_data.gprop_to_dbus_fcn)
return property_info->to_dbus_data.gprop_to_dbus_fcn(&prop_value);
return g_dbus_gvalue_to_gvariant(&prop_value, property_info->property_type->dbus_type);
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_BYTES:
nm_assert(G_VALUE_HOLDS(&prop_value, G_TYPE_BYTES));
@ -999,7 +993,6 @@ property_to_dbus(const NMSettInfoSetting * sett_info,
if (!property_info->property_type->to_dbus_fcn) {
nm_assert(!property_info->param_spec);
nm_assert(!property_info->to_dbus_data.none);
return NULL;
}

View file

@ -4480,9 +4480,8 @@ test_setting_metadata(void)
if (!sip->property_type->to_dbus_fcn) {
/* it's allowed to have no to_dbus_fcn(), to ignore a property. But such
* properties must not have a param_spec and no gprop_to_dbus_fcn. */
* properties must not have a param_spec. */
g_assert(!sip->param_spec);
g_assert(!sip->to_dbus_data.none);
} else if (sip->property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_gprop) {
g_assert(sip->param_spec);
switch (sip->property_type->typdata_to_dbus.gprop_type) {
@ -4509,9 +4508,6 @@ test_setting_metadata(void)
}
g_assert_not_reached();
check_done:;
if (sip->property_type->typdata_to_dbus.gprop_type
!= NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT)
g_assert(!sip->to_dbus_data.gprop_to_dbus_fcn);
can_set_including_default = TRUE;
}

View file

@ -667,7 +667,6 @@ typedef gboolean (*NMSettInfoPropMissingFromDBusFcn)(NMSetting * setting
const char * property,
NMSettingParseFlags parse_flags,
GError ** error);
typedef GVariant *(*NMSettInfoPropGPropToDBusFcn)(const GValue *from);
typedef void (*NMSettInfoPropGPropFromDBusFcn)(GVariant *from, GValue *to);
const NMSettInfoSetting *nmtst_sett_info_settings(void);
@ -746,11 +745,6 @@ struct _NMSettInfoProperty {
bool direct_has_special_setter : 1;
struct {
union {
gpointer none;
NMSettInfoPropGPropToDBusFcn gprop_to_dbus_fcn;
};
/* Usually, properties that are set to the default value for the GParamSpec
* are not serialized to GVariant (and NULL is returned by to_dbus_data().
* Set this flag to force always converting the property even if the value