[PATCH 2/3] iface-modem-signal: port mm_iface_modem_signal_enable to use GTask
Ben Chan
benchan at chromium.org
Thu Apr 13 01:52:48 UTC 2017
---
src/mm-iface-modem-signal.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/mm-iface-modem-signal.c b/src/mm-iface-modem-signal.c
index fdfdc7e0..f8348831 100644
--- a/src/mm-iface-modem-signal.c
+++ b/src/mm-iface-modem-signal.c
@@ -330,7 +330,7 @@ mm_iface_modem_signal_enable_finish (MMIfaceModemSignal *self,
GAsyncResult *res,
GError **error)
{
- return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
void
@@ -339,21 +339,17 @@ mm_iface_modem_signal_enable (MMIfaceModemSignal *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GSimpleAsyncResult *result;
+ GTask *task;
GError *error = NULL;
- result = g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- mm_iface_modem_signal_enable);
+ task = g_task_new (self, cancellable, callback, user_data);
if (!setup_refresh_context (self, FALSE, 0, &error))
- g_simple_async_result_take_error (result, error);
+ g_task_return_error (task, error);
else
- g_simple_async_result_set_op_res_gboolean (result, TRUE);
+ g_task_return_boolean (task, TRUE);
- g_simple_async_result_complete_in_idle (result);
- g_object_unref (result);
+ g_object_unref (task);
}
/*****************************************************************************/
--
2.12.2.715.g7642488e1d-goog
More information about the ModemManager-devel
mailing list