aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/zte/mm-broadband-modem-zte.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/plugins/zte/mm-broadband-modem-zte.c b/plugins/zte/mm-broadband-modem-zte.c
index d356c72d..5f43ef07 100644
--- a/plugins/zte/mm-broadband-modem-zte.c
+++ b/plugins/zte/mm-broadband-modem-zte.c
@@ -437,13 +437,13 @@ set_current_modes_finish (MMIfaceModem *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);
}
static void
allowed_mode_update_ready (MMBroadbandModemZte *self,
GAsyncResult *res,
- GSimpleAsyncResult *operation_result)
+ GTask *task)
{
GError *error = NULL;
@@ -451,11 +451,10 @@ allowed_mode_update_ready (MMBroadbandModemZte *self,
if (error)
/* Let the error be critical. */
- g_simple_async_result_take_error (operation_result, error);
+ g_task_return_error (task, error);
else
- g_simple_async_result_set_op_res_gboolean (operation_result, TRUE);
- g_simple_async_result_complete (operation_result);
- g_object_unref (operation_result);
+ g_task_return_boolean (task, TRUE);
+ g_object_unref (task);
}
static void
@@ -465,15 +464,12 @@ set_current_modes (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GSimpleAsyncResult *result;
+ GTask *task;
gchar *command;
gint cm_mode = -1;
gint pref_acq = -1;
- result = g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- set_current_modes);
+ task = g_task_new (self, NULL, callback, user_data);
if (allowed == MM_MODEM_MODE_2G) {
cm_mode = 1;
@@ -509,18 +505,17 @@ set_current_modes (MMIfaceModem *self,
allowed_str = mm_modem_mode_build_string_from_mask (allowed);
preferred_str = mm_modem_mode_build_string_from_mask (preferred);
- g_simple_async_result_set_error (result,
- MM_CORE_ERROR,
- MM_CORE_ERROR_FAILED,
- "Requested mode (allowed: '%s', preferred: '%s') not "
- "supported by the modem.",
- allowed_str,
- preferred_str);
+ g_task_return_new_error (task,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_FAILED,
+ "Requested mode (allowed: '%s', preferred: '%s') not "
+ "supported by the modem.",
+ allowed_str,
+ preferred_str);
+ g_object_unref (task);
+
g_free (allowed_str);
g_free (preferred_str);
-
- g_simple_async_result_complete_in_idle (result);
- g_object_unref (result);
return;
}
@@ -531,7 +526,7 @@ set_current_modes (MMIfaceModem *self,
3,
FALSE,
(GAsyncReadyCallback)allowed_mode_update_ready,
- result);
+ task);
g_free (command);
}