summaryrefslogtreecommitdiff
path: root/gcr
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2019-12-21 19:25:08 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2021-01-12 22:13:52 +0000
commit8b2d3c614739410107a65ac23745eccd3c43c9a6 (patch)
treee1d0d5c438874cc08bed9abf2b7da771a0f7cebc /gcr
parent821e0d0d7262968e2c2168b222ff5dde6f51a02b (diff)
downloadgcr-8b2d3c614739410107a65ac23745eccd3c43c9a6.tar.gz
gcr-memory-icon: Port to GTask
Diffstat (limited to 'gcr')
-rw-r--r--gcr/gcr-memory-icon.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcr/gcr-memory-icon.c b/gcr/gcr-memory-icon.c
index 27edefc..40a4527 100644
--- a/gcr/gcr-memory-icon.c
+++ b/gcr/gcr-memory-icon.c
@@ -138,21 +138,22 @@ static void
_gcr_memory_icon_load_async (GLoadableIcon *icon, int size, GCancellable *cancellable,
GAsyncReadyCallback callback, gpointer user_data)
{
- GSimpleAsyncResult *res;
+ GTask *task;
- res = g_simple_async_result_new (G_OBJECT (icon), callback, user_data,
- _gcr_memory_icon_load_async);
+ task = g_task_new (icon, cancellable, callback, user_data);
+ g_task_set_source_tag (task, _gcr_memory_icon_load_async);
- g_simple_async_result_complete_in_idle (res);
- g_object_unref (res);
+ /* We don't do anything with the task value, so just return a bogus value */
+ g_task_return_pointer (task, NULL, NULL);
+ g_object_unref (task);
}
static GInputStream*
_gcr_memory_icon_finish (GLoadableIcon *icon, GAsyncResult *res, char **type,
GError **error)
{
- g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (icon),
- _gcr_memory_icon_load_async), NULL);
+ g_return_val_if_fail (g_task_is_valid (res, icon), NULL);
+
return _gcr_memory_icon_load (icon, 0, type, NULL, error);
}