aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-09-13 22:30:03 +0200
committerAleksander Morgado <aleksander@aleksander.es>2017-10-06 09:58:23 +0200
commitd9de874db3a23689f82337bc889ee47bcee15de0 (patch)
treec2196f1ee01cf8d9389dd260cde8f90b180fb3df /plugins
parente072f4bc7731a2a4710de7be42dadcb54508a01d (diff)
thuraya: port load_supported_modes to GTask
Diffstat (limited to 'plugins')
-rw-r--r--plugins/thuraya/mm-broadband-modem-thuraya.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/plugins/thuraya/mm-broadband-modem-thuraya.c b/plugins/thuraya/mm-broadband-modem-thuraya.c
index c381439c..071ef3f9 100644
--- a/plugins/thuraya/mm-broadband-modem-thuraya.c
+++ b/plugins/thuraya/mm-broadband-modem-thuraya.c
@@ -91,26 +91,23 @@ load_operator_name (MMIfaceModem3gpp *self,
/* Load supported modes (Modem inteface) */
static GArray *
-load_supported_modes_finish (MMIfaceModem *self,
- GAsyncResult *res,
- GError **error)
+load_supported_modes_finish (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error)
{
- return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)));
+ return g_task_propagate_pointer (G_TASK (res), error);
}
static void
-load_supported_modes (MMIfaceModem *self,
- GAsyncReadyCallback callback,
- gpointer user_data)
+load_supported_modes (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
- GSimpleAsyncResult *result;
- GArray *combinations;
- MMModemModeCombination mode;
+ GTask *task;
+ GArray *combinations;
+ MMModemModeCombination mode;
- result = g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- load_supported_modes);
+ task = g_task_new (self, NULL, callback, user_data);
/* Build list of combinations */
combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1);
@@ -120,9 +117,8 @@ load_supported_modes (MMIfaceModem *self,
mode.preferred = MM_MODEM_MODE_NONE;
g_array_append_val (combinations, mode);
- g_simple_async_result_set_op_res_gpointer (result, combinations, (GDestroyNotify) g_array_unref);
- g_simple_async_result_complete_in_idle (result);
- g_object_unref (result);
+ g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref);
+ g_object_unref (task);
}
/*****************************************************************************/