broadband-modem: port modem_3gpp_ussd_{setup,cleanup}_unsolicited_result_codes to use GTask
This commit is contained in:
committed by
Aleksander Morgado
parent
8b5aa2a41c
commit
249f880c3c
@@ -4901,7 +4901,7 @@ modem_3gpp_ussd_setup_cleanup_unsolicited_result_codes_finish (MMIfaceModem3gppU
|
||||
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);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
@@ -5086,15 +5086,10 @@ set_unsolicited_result_code_handlers (MMIfaceModem3gppUssd *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *result;
|
||||
MMPortSerialAt *ports[2];
|
||||
GRegex *cusd_regex;
|
||||
guint i;
|
||||
|
||||
result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
set_unsolicited_events_handlers);
|
||||
GTask *task;
|
||||
|
||||
cusd_regex = mm_3gpp_cusd_regex_get ();
|
||||
ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self));
|
||||
@@ -5117,9 +5112,10 @@ set_unsolicited_result_code_handlers (MMIfaceModem3gppUssd *self,
|
||||
}
|
||||
|
||||
g_regex_unref (cusd_regex);
|
||||
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);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user