mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 17:50:16 +01:00
libnm: change "nm_sett_info_propert_type_strdict" to use gprop_type for to_dbus_fcn()
(cherry picked from commit 6d39014660)
This commit is contained in:
parent
97a25c5965
commit
7f21fbad31
4 changed files with 10 additions and 8 deletions
|
|
@ -574,6 +574,9 @@ _nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * s
|
|||
tmp_array = g_value_get_boxed(&prop_value);
|
||||
nm_assert(tmp_array);
|
||||
return nm_g_variant_new_au((const guint32 *) tmp_array->data, tmp_array->len);
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT:
|
||||
nm_assert(G_VALUE_HOLDS(&prop_value, G_TYPE_HASH_TABLE));
|
||||
return nm_utils_strdict_to_variant_ass(g_value_get_boxed(&prop_value));
|
||||
}
|
||||
|
||||
return nm_assert_unreachable_val(NULL);
|
||||
|
|
|
|||
|
|
@ -758,12 +758,6 @@ _nm_utils_hash_values_to_slist(GHashTable *hash)
|
|||
return list;
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_nm_utils_strdict_to_dbus(const GValue *prop_value)
|
||||
{
|
||||
return nm_utils_strdict_to_variant_ass(g_value_get_boxed(prop_value));
|
||||
}
|
||||
|
||||
void
|
||||
_nm_utils_strdict_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
{
|
||||
|
|
@ -781,8 +775,9 @@ _nm_utils_strdict_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
|||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_strdict =
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.gprop_to_dbus_fcn = _nm_utils_strdict_to_dbus,
|
||||
.gprop_from_dbus_fcn = _nm_utils_strdict_from_dbus, );
|
||||
.gprop_from_dbus_fcn = _nm_utils_strdict_from_dbus,
|
||||
.typdata_to_dbus.gprop_type =
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT);
|
||||
|
||||
GHashTable *
|
||||
_nm_utils_copy_strdict(GHashTable *strdict)
|
||||
|
|
|
|||
|
|
@ -4388,6 +4388,9 @@ test_setting_metadata(void)
|
|||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_GARRAY_UINT:
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_ARRAY);
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT:
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_HASH_TABLE);
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT:
|
||||
goto check_done;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -677,6 +677,7 @@ typedef enum _nm_packed {
|
|||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_ENUM,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_FLAGS,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_GARRAY_UINT,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT,
|
||||
} NMSettingPropertyToDBusFcnGPropType;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue