[eog] EogImage: Allow calling image_load outside of EogJobs



commit 63e09eee28734df858ddbf962c507a9eed7f39c5
Author: Felix Riemann <friemann gnome org>
Date:   Sun Jun 16 16:03:05 2013 +0200

    EogImage: Allow calling image_load outside of EogJobs
    
    This is still needed for the statusbar-date plugin.
    EogImage needs to be aware of the load jobs to get this away.

 src/eog-image.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/eog-image.c b/src/eog-image.c
index 24791b5..d372369 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -1088,13 +1088,17 @@ eog_image_real_load (EogImage *img,
 
                bytes_read_total += bytes_read;
 
-               /* check that load job wasn't cancelled */
-               if (eog_job_is_cancelled (job)) {
-                       eog_image_cancel_load (img);
-                       continue;
-               } else {
-                       float progress = (float) bytes_read_total / (float) priv->bytes;
-                       eog_job_set_progress (job, progress);
+               /* For now allow calling from outside of jobs */
+               if (job != NULL)
+               {
+                       /* check that load job wasn't cancelled */
+                       if (eog_job_is_cancelled (job)) {
+                               eog_image_cancel_load (img);
+                               continue;
+                       } else {
+                               float progress = (float) bytes_read_total / (float) priv->bytes;
+                               eog_job_set_progress (job, progress);
+                       }
                }
 
                if (first_run) {


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