aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2017-10-06 15:31:29 -0700
committerAleksander Morgado <aleksander@aleksander.es>2017-10-07 10:41:20 +0200
commitaee8bcc7489836a77bfe1c7521dd3bbc55e8f8df (patch)
tree38fa87d037c03bf9a27372d31fee2cc36b6e1973 /plugins
parent164ce738476e5af8a2f44fa1967eb7f821b1579c (diff)
iridium: port load_supported_modes to use GTask
Diffstat (limited to 'plugins')
-rw-r--r--plugins/iridium/mm-broadband-modem-iridium.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/iridium/mm-broadband-modem-iridium.c b/plugins/iridium/mm-broadband-modem-iridium.c
index 7c3a86d9..a5a8495f 100644
--- a/plugins/iridium/mm-broadband-modem-iridium.c
+++ b/plugins/iridium/mm-broadband-modem-iridium.c
@@ -224,7 +224,7 @@ 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
@@ -232,14 +232,9 @@ load_supported_modes (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GSimpleAsyncResult *result;
GArray *combinations;
MMModemModeCombination mode;
-
- result = g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- load_supported_modes);
+ GTask *task;
/* Build list of combinations */
combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1);
@@ -249,9 +244,9 @@ 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);
+ task = g_task_new (self, NULL, callback, user_data);
+ g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref);
+ g_object_unref (task);
}
/*****************************************************************************/