libnm: replace _nm_utils_bytes_to_dbus() with nm_utils_gbytes_get_variant_ay()

This commit is contained in:
Thomas Haller 2018-08-13 21:33:56 +02:00
parent c06a55958b
commit e730f7429d
3 changed files with 1 additions and 19 deletions

View file

@ -573,7 +573,7 @@ get_property_for_dbus (NMSetting *setting,
else if (g_type_is_a (prop_value.g_type, G_TYPE_FLAGS))
dbus_value = g_variant_new_uint32 (g_value_get_flags (&prop_value));
else if (prop_value.g_type == G_TYPE_BYTES)
dbus_value = _nm_utils_bytes_to_dbus (&prop_value);
dbus_value = nm_utils_gbytes_to_variant_ay (g_value_get_boxed (&prop_value));
else
dbus_value = g_dbus_gvalue_to_gvariant (&prop_value, variant_type_for_gtype (prop_value.g_type));
g_value_unset (&prop_value);

View file

@ -74,7 +74,6 @@ GVariant * _nm_utils_strdict_to_dbus (const GValue *prop_value);
void _nm_utils_strdict_from_dbus (GVariant *dbus_value,
GValue *prop_value);
GVariant * _nm_utils_bytes_to_dbus (const GValue *prop_value);
void _nm_utils_bytes_from_dbus (GVariant *dbus_value,
GValue *prop_value);

View file

@ -647,23 +647,6 @@ _nm_utils_ptrarray_find_first (gconstpointer *list, gssize len, gconstpointer ne
return -1;
}
GVariant *
_nm_utils_bytes_to_dbus (const GValue *prop_value)
{
GBytes *bytes = g_value_get_boxed (prop_value);
if (bytes) {
return g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes),
1);
} else {
return g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
NULL, 0,
1);
}
}
void
_nm_utils_bytes_from_dbus (GVariant *dbus_value,
GValue *prop_value)