[gcr/wip/nielsdg/initial-gtask: 40/42] frob-import-button: Port to GTask



commit 6e1669c7d9bc9db3c8ebe65ac7f14b6b354a766c
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon Dec 23 09:42:07 2019 +0100

    frob-import-button: Port to GTask

 ui/frob-import-button.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/ui/frob-import-button.c b/ui/frob-import-button.c
index 7b386a8..d876d81 100644
--- a/ui/frob-import-button.c
+++ b/ui/frob-import-button.c
@@ -70,14 +70,14 @@ mock_importer_import_async (GcrImporter *importer,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
 {
-       GSimpleAsyncResult *res;
+       GTask *task;
 
-       res = g_simple_async_result_new (G_OBJECT (importer), callback, user_data,
-                                        mock_importer_import_async);
+       task = g_task_new (importer, cancellable, callback, user_data);
+       g_task_set_source_tag (task, mock_importer_import_async);
 
        g_printerr ("Import %p\n", importer);
-       g_simple_async_result_complete_in_idle (res);
-       g_object_unref (res);
+       g_task_return_boolean (task, TRUE);
+       g_clear_object (&task);
 }
 
 
@@ -86,7 +86,7 @@ mock_importer_import_finish (GcrImporter *importer,
                              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);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]