diff options
author | Ben Chan <benchan@chromium.org> | 2017-09-19 03:31:58 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-20 09:30:27 -0700 |
commit | a62d34c35a26312a0e565e85960d12841a53fceb (patch) | |
tree | 974268fb94623e5143c3f5c23de4d0d84b48198c | |
parent | 4cb6f0e5aa1038e4335e062bf2a4d0bc2d8902b6 (diff) |
hso: port hso_custom_init to use GTask
-rw-r--r-- | plugins/option/mm-plugin-hso.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/option/mm-plugin-hso.c b/plugins/option/mm-plugin-hso.c index 3a45ef38..a842b0c7 100644 --- a/plugins/option/mm-plugin-hso.c +++ b/plugins/option/mm-plugin-hso.c @@ -46,7 +46,7 @@ hso_custom_init_finish (MMPortProbe *probe, GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } static void @@ -57,7 +57,7 @@ hso_custom_init (MMPortProbe *probe, gpointer user_data) { MMKernelDevice *kernel_port; - GSimpleAsyncResult *result; + GTask *task; const gchar *subsys, *sysfs_path; subsys = mm_port_probe_get_port_subsys (probe); @@ -102,13 +102,9 @@ hso_custom_init (MMPortProbe *probe, g_free (hsotype_path); } - result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - hso_custom_init); - 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 (probe, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ |