diff options
author | Ben Chan <benchan@chromium.org> | 2017-09-26 05:33:10 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-28 10:49:56 +0200 |
commit | 43bf7c764b44dff0eedf2a6a99a57a975f882563 (patch) | |
tree | dc8e1be5b610b0b7a626d9ab62211bf6828f78ee | |
parent | 2e7aff84a62dfcedaaf22e47a42ea6bb152e8421 (diff) |
mbm: port modem_after_sim_unlock to use GTask
-rw-r--r-- | plugins/mbm/mm-broadband-modem-mbm.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/mbm/mm-broadband-modem-mbm.c b/plugins/mbm/mm-broadband-modem-mbm.c index 2fd1653a..2b841a14 100644 --- a/plugins/mbm/mm-broadband-modem-mbm.c +++ b/plugins/mbm/mm-broadband-modem-mbm.c @@ -154,14 +154,14 @@ modem_after_sim_unlock_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -170,15 +170,12 @@ modem_after_sim_unlock (MMIfaceModem *self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); /* wait so sim pin is done */ - g_timeout_add (500, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add (500, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ |