diff options
author | Ben Chan <benchan@chromium.org> | 2017-09-12 08:32:35 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-13 16:36:49 +0200 |
commit | eb59cf86172991ba9ef7331c47bdc9e096317044 (patch) | |
tree | ad5a6cc2ff80f325d1c0486e8b5224bdb7ed0d86 | |
parent | b56ea695896b5290e27b1a2d0b13fb07c005df56 (diff) |
novatel-lte: port load_supported_bands to use GTask
-rw-r--r-- | plugins/novatel/mm-broadband-modem-novatel-lte.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/plugins/novatel/mm-broadband-modem-novatel-lte.c b/plugins/novatel/mm-broadband-modem-novatel-lte.c index 9a790e36..6695afe7 100644 --- a/plugins/novatel/mm-broadband-modem-novatel-lte.c +++ b/plugins/novatel/mm-broadband-modem-novatel-lte.c @@ -311,9 +311,7 @@ load_supported_bands_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - /* Never fails */ - return (GArray *) 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 @@ -321,14 +319,11 @@ load_supported_bands (MMIfaceModem *self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; GArray *bands; guint i; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_bands); + task = g_task_new (self, NULL, callback, user_data); /* * The modem doesn't support telling us what bands are supported; @@ -340,11 +335,8 @@ load_supported_bands (MMIfaceModem *self, g_array_append_val(bands, bandbits[i]); } - g_simple_async_result_set_op_res_gpointer (result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); + g_object_unref (task); } /*****************************************************************************/ |