[shotwell/shotwell-0.20: 5/6] Update displayed image after straighten: Bug #719120



commit 2bd4593826be74c53ec87784a84edae0411ccf25
Author: Jim Nelson <jim yorba org>
Date:   Fri Sep 26 14:32:08 2014 -0700

    Update displayed image after straighten: Bug #719120
    
    When a straighten occurs, the displayed image was not updated.

 src/Commands.vala    |    8 ++++++++
 src/PixbufCache.vala |   12 +++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/Commands.vala b/src/Commands.vala
index feaf0e1..04b771c 100644
--- a/src/Commands.vala
+++ b/src/Commands.vala
@@ -795,8 +795,16 @@ public class StraightenCommand : GenericPhotoTransformationCommand {
     }
     
     public override void execute_on_photo(Photo photo) {
+        // thaw collection so both alterations are signalled at the same time
+        DataCollection? collection = photo.get_membership();
+        if (collection != null)
+            collection.freeze_notifications();
+        
         photo.set_straighten(theta);
         photo.set_crop(crop);
+        
+        if (collection != null)
+            collection.thaw_notifications();
     }
 }
 
diff --git a/src/PixbufCache.vala b/src/PixbufCache.vala
index 8b8f276..0708f5e 100644
--- a/src/PixbufCache.vala
+++ b/src/PixbufCache.vala
@@ -265,6 +265,10 @@ public class PixbufCache : Object {
             return;
         }
         
+#if TRACE_PIXBUF_CACHE
+        debug("%s %s fetched into pixbuf cache", type.to_string(), job.photo.to_string());
+#endif
+        
         encache(job.photo, job.pixbuf);
         
         // fire signal
@@ -279,16 +283,14 @@ public class PixbufCache : Object {
             Photo photo = (Photo) object;
             
             if (in_progress.has_key(photo)) {
-                // Load is in progress, must cancel.
+                // Load is in progress, must cancel, but consider in-cache (since it was decached
+                // before being put into progress)
                 in_progress.get(photo).cancel();
                 in_progress.unset(photo);
+            } else if (!cache.has_key(photo)) {
                 continue;
             }
             
-            // only interested if in this cache
-            if (!cache.has_key(photo))
-                continue;
-            
             decache(photo);
             
 #if TRACE_PIXBUF_CACHE


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