diff options
author | Thomas Haller <thaller@redhat.com> | 2018-08-13 21:33:56 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-08-22 10:49:34 +0200 |
commit | e730f7429dabd92920691bf210eca32323ebecab (patch) | |
tree | 17185d18d1c9d9457e5f4718774992ddcc455867 | |
parent | c06a55958b96d549726411efd5583ea05df62a86 (diff) | |
download | NetworkManager-e730f7429dabd92920691bf210eca32323ebecab.tar.gz |
libnm: replace _nm_utils_bytes_to_dbus() with nm_utils_gbytes_get_variant_ay()
-rw-r--r-- | libnm-core/nm-setting.c | 2 | ||||
-rw-r--r-- | libnm-core/nm-utils-private.h | 1 | ||||
-rw-r--r-- | libnm-core/nm-utils.c | 17 |
3 files changed, 1 insertions, 19 deletions
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index d59e3df79d..0cec516517 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -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); diff --git a/libnm-core/nm-utils-private.h b/libnm-core/nm-utils-private.h index 0605d83fa1..b886730a35 100644 --- a/libnm-core/nm-utils-private.h +++ b/libnm-core/nm-utils-private.h @@ -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); diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index eb002d4811..0acb96b281 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -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) |