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

Aleksander Morgado aleksander at aleksander.es
Sat Apr 15 21:23:49 UTC 2017


On 13/04/17 03:52, Ben Chan wrote:
> ---
>  src/mm-iface-modem-signal.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 

Pushed to git master, thanks.

> 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);
>  }
>  
>  /*****************************************************************************/
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list