[gcr/wip/nielsdg/initial-gtask: 20/23] frob-import-button: Port to GTask
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr/wip/nielsdg/initial-gtask: 20/23] frob-import-button: Port to GTask
- Date: Tue, 12 Jan 2021 22:13:54 +0000 (UTC)
commit 18beb50e04119f3635699f013f9d7c8414480d51
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 7b386a88..d876d813 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]