[PATCH 1/3] iface-modem-signal: port mm_modem_iface_signal_disable to use GTask

Ben Chan benchan at chromium.org
Thu Apr 13 01:52:47 UTC 2017


---
 src/mm-iface-modem-signal.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/mm-iface-modem-signal.c b/src/mm-iface-modem-signal.c
index dbf11515..fdfdc7e0 100644
--- a/src/mm-iface-modem-signal.c
+++ b/src/mm-iface-modem-signal.c
@@ -306,7 +306,7 @@ mm_iface_modem_signal_disable_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
@@ -314,18 +314,13 @@ mm_iface_modem_signal_disable (MMIfaceModemSignal *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data)
 {
-    GSimpleAsyncResult *result;
-
-    result = g_simple_async_result_new (G_OBJECT (self),
-                                        callback,
-                                        user_data,
-                                        mm_iface_modem_signal_disable);
+    GTask *task;
 
     teardown_refresh_context (self);
 
-    g_simple_async_result_set_op_res_gboolean (result, TRUE);
-    g_simple_async_result_complete_in_idle (result);
-    g_object_unref (result);
+    task = g_task_new (self, NULL, callback, user_data);
+    g_task_return_boolean (task, TRUE);
+    g_object_unref (task);
 }
 
 /*****************************************************************************/
-- 
2.12.2.715.g7642488e1d-goog



More information about the ModemManager-devel mailing list