[gnome-photos] thumbnailer: Use a GCancellable when handling GenerateThumbnail
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] thumbnailer: Use a GCancellable when handling GenerateThumbnail
- Date: Thu, 23 Feb 2017 09:38:13 +0000 (UTC)
commit 35900cf2745bfa9988c029a65778a8693bb93abc
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Feb 23 10:11:00 2017 +0100
thumbnailer: Use a GCancellable when handling GenerateThumbnail
This will be used in a subsequent commit to cancel ongoing
GenerateThumbnail calls.
https://bugzilla.gnome.org/show_bug.cgi?id=763329
src/photos-thumbnailer.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-thumbnailer.c b/src/photos-thumbnailer.c
index bc656cf..9e05c0d 100644
--- a/src/photos-thumbnailer.c
+++ b/src/photos-thumbnailer.c
@@ -574,6 +574,8 @@ photos_thumbnailer_handle_generate_thumbnail (PhotosThumbnailer *self,
const gchar *thumbnail_path,
gint thumbnail_size)
{
+ GCancellable *cancellable = NULL;
+
g_return_val_if_fail (PHOTOS_IS_THUMBNAILER (self), FALSE);
g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), FALSE);
g_return_val_if_fail (uri != NULL && uri[0] != '\0', FALSE);
@@ -587,6 +589,8 @@ photos_thumbnailer_handle_generate_thumbnail (PhotosThumbnailer *self,
if (pipeline_uri[0] == '\0')
pipeline_uri = NULL;
+ cancellable = g_cancellable_new ();
+
g_application_hold (G_APPLICATION (self));
photos_thumbnailer_generate_thumbnail_async (self,
uri,
@@ -597,10 +601,11 @@ photos_thumbnailer_handle_generate_thumbnail (PhotosThumbnailer *self,
pipeline_uri,
thumbnail_path,
thumbnail_size,
- NULL,
+ cancellable,
photos_thumbnailer_handle_generate_thumbnail_generate_thumbnail,
g_object_ref (invocation));
+ g_object_unref (cancellable);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]