[gthumb] image loader: always set the error if the operation was cancelled



commit f88d7cb6bbe3ccc300c5832857a9c77e808729da
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Jun 29 14:38:29 2013 +0200

    image loader: always set the error if the operation was cancelled

 gthumb/gth-image-loader.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-image-loader.c b/gthumb/gth-image-loader.c
index d0bea2b..7a41894 100644
--- a/gthumb/gth-image-loader.c
+++ b/gthumb/gth-image-loader.c
@@ -199,6 +199,11 @@ load_pixbuf_thread (GSimpleAsyncResult *result,
 
        _g_object_unref (istream);
 
+       if (g_cancellable_is_cancelled (cancellable)) {
+               g_clear_error (&error);
+               g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_CANCELLED, "");
+       }
+
        if (error != NULL) {
                _g_object_unref (image);
                g_simple_async_result_set_from_error (result, error);


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