Commit 0ffed73e authored by Christian Kellner's avatar Christian Kellner

client: use new bolt_proxy_set_async setter

Use the new bolt_proxy_set_async setter and thus remove the custom
conversion code (from flags to GVariant via flags-to-string).
parent 2ca8303e
......@@ -1168,33 +1168,21 @@ bolt_client_set_authmode_async (BoltClient *client,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autofree char *str = NULL;
GError *err = NULL;
GParamSpec *pspec;
GParamSpecFlags *flags_pspec;
GFlagsClass *flags_class;
g_auto(GValue) val = G_VALUE_INIT;
g_return_if_fail (BOLT_IS_CLIENT (client));
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (callback != NULL);
pspec = props[PROP_AUTHMODE];
flags_pspec = G_PARAM_SPEC_FLAGS (pspec);
flags_class = flags_pspec->flags_class;
str = bolt_flags_class_to_string (flags_class, mode, &err);
if (str == NULL)
{
g_task_report_error (client, callback, user_data, NULL, err);
return;
}
g_value_init (&val, BOLT_TYPE_AUTH_MODE);
g_value_set_flags (&val, mode);
bolt_proxy_set_property_async (BOLT_PROXY (client),
g_param_spec_get_nick (pspec),
g_variant_new ("s", str),
cancellable,
callback,
user_data);
bolt_proxy_set_async (BOLT_PROXY (client),
props[PROP_AUTHMODE],
&val,
cancellable,
callback,
user_data);
}
gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment