[shotwell/shotwell-0.26] Fix assertion on removing photo from last import



commit 102c304d32f605081871bda77c23a5c021f87245
Author: stefan <stefan home aon at>
Date:   Wed Aug 30 21:11:13 2017 +0200

    Fix assertion on removing photo from last import
    
    The state of raw development does not affect filtering anymore. Filtering
    photos shows: JPEG, RAW only and RAW+JPEG Filtering RAW shows: RAW only
    and RAW+JPEG
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719142

 src/MediaViewTracker.vala |    7 ++-----
 src/SearchFilter.vala     |   11 ++++-------
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/MediaViewTracker.vala b/src/MediaViewTracker.vala
index 27fcf4a..ee96339 100644
--- a/src/MediaViewTracker.vala
+++ b/src/MediaViewTracker.vala
@@ -34,8 +34,7 @@ public class MediaAccumulator : Object, Core.TrackerAccumulator {
                 raw++;
             }
             
-            if (photo.get_master_file_format() != PhotoFileFormat.RAW || 
-                photo.is_raw_developer_available(RawDeveloper.CAMERA)) {
+            if (photo.get_master_file_format() != PhotoFileFormat.RAW) {
                 photos++;
             }
         } else if (source is VideoSource) {
@@ -67,8 +66,7 @@ public class MediaAccumulator : Object, Core.TrackerAccumulator {
                 raw--;
             }
             
-            if (photo.get_master_file_format() != PhotoFileFormat.RAW || 
-                photo.is_raw_developer_available(RawDeveloper.CAMERA)) {
+            if (photo.get_master_file_format() != PhotoFileFormat.RAW) {
                 assert(photos > 0);
                 photos--;
             }
@@ -111,4 +109,3 @@ public class MediaAccumulator : Object, Core.TrackerAccumulator {
         return "%d photos/%d videos/%d raw/%d flagged".printf(photos, videos, raw, flagged);
     }
 }
-
diff --git a/src/SearchFilter.vala b/src/SearchFilter.vala
index 04e5593..fba5488 100644
--- a/src/SearchFilter.vala
+++ b/src/SearchFilter.vala
@@ -204,12 +204,8 @@ public abstract class DefaultSearchViewFilter : SearchViewFilter {
             } else if (source is Photo) {
                 Photo photo = source as Photo;
                 if (photo.get_master_file_format() == PhotoFileFormat.RAW) {
-                    if (photo.is_raw_developer_available(RawDeveloper.CAMERA)) {
-                        if (!show_media_photos && !show_media_raw)
-                            return false;
-                    } else if (!show_media_raw) {
+                    if (!show_media_photos && !show_media_raw)
                         return false;
-                    }
                 } else if (!show_media_photos)
                     return false;
             }
@@ -1170,7 +1166,9 @@ public class SearchFilterToolbar : Gtk.Revealer {
     
     private void on_media_context_changed(bool has_photos, bool has_videos, bool has_raw,
         bool has_flagged) {
-        if (has_photos)
+        if (has_photos || has_raw)
+            // As a user, I would expect, that a raw photo is still a photo.
+            // Let's enable the photo button even if there ar only raw photos.
             toolbtn_photos.set_icon_name(Resources.ICON_FILTER_PHOTOS);
         else
             toolbtn_photos.set_icon_name(Resources.ICON_FILTER_PHOTOS_DISABLED);
@@ -1391,4 +1389,3 @@ public class SearchFilterToolbar : Gtk.Revealer {
         search_box.get_focus();
     }
 }
-


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