[eog/gnome-3-36] EogJobs: Ensure thumbnail job emits finished signal even if failed
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog/gnome-3-36] EogJobs: Ensure thumbnail job emits finished signal even if failed
- Date: Sat, 4 Jul 2020 13:40:36 +0000 (UTC)
commit ecb744f8d2fcf2f42aa858b07de72bf0fb56c164
Author: Felix Riemann <friemann gnome org>
Date: Sat Jun 20 16:42:42 2020 +0200
EogJobs: Ensure thumbnail job emits finished signal even if failed
Otherwise the busy image will be displayed indefinetely if no
thumbnail can be generated. Once the finished signal gets emitted
the missing thumbnail will be shown instead.
(cherry picked from commit f7c1782864d20406ebff64e8338fdf24f70bc29b)
src/eog-jobs.c | 70 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 36 insertions(+), 34 deletions(-)
---
diff --git a/src/eog-jobs.c b/src/eog-jobs.c
index 8a21e66c..c1813b21 100644
--- a/src/eog-jobs.c
+++ b/src/eog-jobs.c
@@ -1318,11 +1318,6 @@ static void
eog_job_thumbnail_run (EogJob *job)
{
EogJobThumbnail *job_thumbnail;
- gchar *original_width;
- gchar *original_height;
- gint width;
- gint height;
- GdkPixbuf *pixbuf;
/* initialization */
g_return_if_fail (EOG_IS_JOB_THUMBNAIL (job));
@@ -1339,36 +1334,43 @@ eog_job_thumbnail_run (EogJob *job)
job_thumbnail->thumbnail = eog_thumbnail_load (job_thumbnail->image,
&job->error);
- if (!job_thumbnail->thumbnail) {
- job->finished = TRUE;
- return;
- }
-
- /* create the image thumbnail */
- original_width = g_strdup (gdk_pixbuf_get_option (job_thumbnail->thumbnail,
"tEXt::Thumb::Image::Width"));
- original_height = g_strdup (gdk_pixbuf_get_option (job_thumbnail->thumbnail,
"tEXt::Thumb::Image::Height"));
-
- pixbuf = eog_thumbnail_fit_to_size (job_thumbnail->thumbnail,
- EOG_LIST_STORE_THUMB_SIZE);
-
- g_object_unref (job_thumbnail->thumbnail);
- job_thumbnail->thumbnail = eog_thumbnail_add_frame (pixbuf);
- g_object_unref (pixbuf);
-
- if (original_width) {
- sscanf (original_width, "%i", &width);
- g_object_set_data (G_OBJECT (job_thumbnail->thumbnail),
- EOG_THUMBNAIL_ORIGINAL_WIDTH,
- GINT_TO_POINTER (width));
- g_free (original_width);
- }
+ if (job_thumbnail->thumbnail) {
+ GdkPixbuf *pixbuf;
+ gchar *original_width;
+ gchar *original_height;
+ gint width;
+ gint height;
+
+ /* create the image thumbnail */
+ original_width = g_strdup (gdk_pixbuf_get_option
+ (job_thumbnail->thumbnail,
+ "tEXt::Thumb::Image::Width"));
+ original_height = g_strdup (gdk_pixbuf_get_option
+ (job_thumbnail->thumbnail,
+ "tEXt::Thumb::Image::Height"));
+
+ pixbuf = eog_thumbnail_fit_to_size (job_thumbnail->thumbnail,
+ EOG_LIST_STORE_THUMB_SIZE);
+
+ g_object_unref (job_thumbnail->thumbnail);
+ job_thumbnail->thumbnail = eog_thumbnail_add_frame (pixbuf);
+ g_object_unref (pixbuf);
+
+ if (original_width) {
+ sscanf (original_width, "%i", &width);
+ g_object_set_data (G_OBJECT (job_thumbnail->thumbnail),
+ EOG_THUMBNAIL_ORIGINAL_WIDTH,
+ GINT_TO_POINTER (width));
+ g_free (original_width);
+ }
- if (original_height) {
- sscanf (original_height, "%i", &height);
- g_object_set_data (G_OBJECT (job_thumbnail->thumbnail),
- EOG_THUMBNAIL_ORIGINAL_HEIGHT,
- GINT_TO_POINTER (height));
- g_free (original_height);
+ if (original_height) {
+ sscanf (original_height, "%i", &height);
+ g_object_set_data (G_OBJECT (job_thumbnail->thumbnail),
+ EOG_THUMBNAIL_ORIGINAL_HEIGHT,
+ GINT_TO_POINTER (height));
+ g_free (original_height);
+ }
}
/* show info for debugging */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]