mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-07 08:40:59 +00:00
shared,core: rename and move function to nm_utils_strdict_to_variant_asv()
This commit is contained in:
parent
91d6461761
commit
cdb38df7e5
|
@ -527,6 +527,33 @@ out:
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
GVariant *
|
||||
nm_utils_strdict_to_variant_asv (GHashTable *strdict)
|
||||
{
|
||||
gs_free NMUtilsNamedValue *values_free = NULL;
|
||||
NMUtilsNamedValue values_prepared[20];
|
||||
const NMUtilsNamedValue *values;
|
||||
GVariantBuilder builder;
|
||||
guint i;
|
||||
guint n;
|
||||
|
||||
values = nm_utils_named_values_from_strdict (strdict,
|
||||
&n,
|
||||
values_prepared,
|
||||
&values_free);
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||
for (i = 0; i < n; i++) {
|
||||
g_variant_builder_add (&builder,
|
||||
"{sv}",
|
||||
values[i].name,
|
||||
g_variant_new_string (values[i].value_str));
|
||||
}
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* nm_strquote:
|
||||
* @buf: the output buffer of where to write the quoted @str argument.
|
||||
|
|
|
@ -422,6 +422,7 @@ gboolean nm_utils_gbytes_equal_mem (GBytes *bytes,
|
|||
GVariant *nm_utils_gbytes_to_variant_ay (GBytes *bytes);
|
||||
|
||||
GVariant *nm_utils_strdict_to_variant_ass (GHashTable *strdict);
|
||||
GVariant *nm_utils_strdict_to_variant_asv (GHashTable *strdict);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
@ -4108,33 +4108,6 @@ nm_utils_parse_dns_domain (const char *domain, gboolean *is_routing)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
GVariant *
|
||||
nm_utils_strdict_to_variant (GHashTable *options)
|
||||
{
|
||||
gs_free NMUtilsNamedValue *values_free = NULL;
|
||||
NMUtilsNamedValue values_prepared[20];
|
||||
const NMUtilsNamedValue *values;
|
||||
GVariantBuilder builder;
|
||||
guint i;
|
||||
guint n;
|
||||
|
||||
values = nm_utils_named_values_from_strdict (options,
|
||||
&n,
|
||||
values_prepared,
|
||||
&values_free);
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||
for (i = 0; i < n; i++) {
|
||||
g_variant_builder_add (&builder,
|
||||
"{sv}",
|
||||
values[i].name,
|
||||
g_variant_new_string (values[i].value_str));
|
||||
}
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static guint32
|
||||
get_max_rate_ht_20 (int mcs)
|
||||
{
|
||||
|
|
|
@ -449,8 +449,6 @@ gboolean nm_utils_validate_plugin (const char *path, struct stat *stat, GError *
|
|||
char **nm_utils_read_plugin_paths (const char *dirname, const char *prefix);
|
||||
char *nm_utils_format_con_diff_for_audit (GHashTable *diff);
|
||||
|
||||
GVariant *nm_utils_strdict_to_variant (GHashTable *options);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* this enum is compatible with ICMPV6_ROUTER_PREF_* (from <linux/icmpv6.h>,
|
||||
|
|
|
@ -75,7 +75,7 @@ nm_dhcp_config_set_options (NMDhcpConfig *self,
|
|||
priv = NM_DHCP_CONFIG_GET_PRIVATE (self);
|
||||
|
||||
nm_g_variant_unref (priv->options);
|
||||
priv->options = g_variant_ref_sink (nm_utils_strdict_to_variant (options));
|
||||
priv->options = g_variant_ref_sink (nm_utils_strdict_to_variant_asv (options));
|
||||
_notify (self, PROP_OPTIONS);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue