Commit b161824c authored by Eric Gregory's avatar Eric Gregory

3085 photo button in filter bar now excludes RAWs

parent 4af327a5
......@@ -30,10 +30,14 @@ public class MediaAccumulator : Object, Core.TrackerAccumulator {
Photo? photo = source as Photo;
if (photo != null) {
photos++;
if (photo.get_master_file_format() == PhotoFileFormat.RAW)
if (photo.get_master_file_format() == PhotoFileFormat.RAW) {
raw++;
}
if (photo.get_master_file_format() != PhotoFileFormat.RAW ||
photo.is_raw_developer_available(RawDeveloper.CAMERA)) {
photos++;
}
} else if (source is VideoSource) {
videos++;
}
......@@ -54,12 +58,16 @@ public class MediaAccumulator : Object, Core.TrackerAccumulator {
Photo? photo = source as Photo;
if (photo != null) {
assert(photos > 0);
photos--;
if (photo.get_master_file_format() == PhotoFileFormat.RAW) {
assert(raw > 0);
raw--;
}
if (photo.get_master_file_format() != PhotoFileFormat.RAW ||
photo.is_raw_developer_available(RawDeveloper.CAMERA)) {
assert(photos > 0);
photos--;
}
} else if (source is Video) {
assert(videos > 0);
videos--;
......
......@@ -194,9 +194,14 @@ public abstract class DefaultSearchViewFilter : SearchViewFilter {
if (!show_media_video)
return false;
} else if (source is Photo) {
if (((Photo) source).get_master_file_format() == PhotoFileFormat.RAW) {
if (!show_media_photos && !show_media_raw)
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) {
return false;
}
} else if (!show_media_photos)
return false;
}
......
......@@ -603,9 +603,14 @@ public class ImportPage : CheckerboardPage {
if (!show_media_video)
return false;
} else if (source is PhotoImportSource) {
if (((PhotoImportSource) source).get_file_format() == PhotoFileFormat.RAW) {
if (!show_media_photos && !show_media_raw)
PhotoImportSource photo = source as PhotoImportSource;
if (photo.get_file_format() == PhotoFileFormat.RAW) {
if (photo.get_associated() != null) {
if (!show_media_photos && !show_media_raw)
return false;
} else if (!show_media_raw) {
return false;
}
} else if (!show_media_photos)
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment