summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml17
-rw-r--r--NEWS19
-rw-r--r--facedetect/meson.build5
-rw-r--r--facedetect/shotwell-facedetect.cpp6
-rw-r--r--flatpak/org.gnome.Shotwell.json7
-rw-r--r--flatpak/patches/libraw-pkgconfig.patch37
-rw-r--r--meson.build6
-rw-r--r--misc/shotwell.appdata.xml.in2
-rw-r--r--src/AppDirs.vala4
-rw-r--r--src/Commands.vala3
-rw-r--r--src/Dialogs.vala4
-rw-r--r--src/Photo.vala2
-rw-r--r--src/PhotoPage.vala8
-rw-r--r--src/Resources.vala2
-rw-r--r--src/SearchFilter.vala5
-rw-r--r--src/camera/ImportPage.vala4
-rw-r--r--src/config/GSettingsEngine.vala7
-rw-r--r--src/db/FaceLocationTable.vala4
-rw-r--r--src/db/FaceTable.vala2
-rw-r--r--src/dialogs/AdjustDateTimeDialog.vala2
-rw-r--r--src/faces/Face.vala3
-rw-r--r--src/faces/FaceLocation.vala4
-rw-r--r--src/faces/FacePage.vala4
-rw-r--r--src/faces/FaceShape.vala4
-rw-r--r--src/faces/Faces.vala20
-rw-r--r--src/faces/FacesBranch.vala4
-rw-r--r--src/faces/FacesTool.vala13
-rw-r--r--src/library/LibraryWindow.vala9
-rw-r--r--src/main.vala6
-rw-r--r--src/meson.build5
-rw-r--r--src/searches/SavedSearchDialog.vala2
-rw-r--r--src/searches/SearchBoolean.vala18
-rw-r--r--src/util/ui.vala2
33 files changed, 90 insertions, 150 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..e6aa308
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,17 @@
+include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
+
+variables:
+ BUNDLE: "org.gnome.Shotwell.Devel.flatpak"
+ GIT_SUBMODULE_STRATEGY: recursive
+
+flatpak:
+ extends: ['.flatpak']
+ image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:41
+ variables:
+ BRANCH: testing
+ MANIFEST_PATH: "flatpak/org.gnome.Shotwell.json"
+ RUNTIME_REPO: "https://flathub.org/repo/flathub.flatpakrepo"
+ # Replace with your application name, as written in the manifest
+ FLATPAK_MODULE: "shotwell"
+ APP_ID: "org.gnome.Shotwell"
+
diff --git a/NEWS b/NEWS
index 5545618..f395027 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,22 @@
+Shotwell 0.30.16 (stable) - 18 May 2022
+ - Fix issue with dark mode wallpapers
+ - Fix compatibility with OpenCV 4
+ - Fix import of videos from Sony A7C
+ - Fix mixed up label in Adjust Date/Time
+ - Fix _LIB dir (missing plugins)
+ - Always enable face tagging functionality
+
+Bugs fixed in this release:
+ - https://gitlab.gnome.org/GNOME/shotwell/issues/1965812
+ - https://gitlab.gnome.org/GNOME/shotwell/issues/1965812
+
+Merge requests included in this release:
+ - https://gitlab.gnome.org/GNOME/shotwell/merge_requests/54
+
+All contributors to this release:
+ - Jens Georg <mail@jensge.org>
+ - Richard B. Kreckel <rbk@in.terlu.de>
+
Shotwell 0.30.15 (stable) - 4 Apr 2022
- Drop nautilus-sendto
- Improve compatibility with Vala 0.56
diff --git a/facedetect/meson.build b/facedetect/meson.build
index 6724abc..bd5f3c3 100644
--- a/facedetect/meson.build
+++ b/facedetect/meson.build
@@ -1,6 +1,9 @@
subproject = ('facedetect')
add_languages('cpp')
-facedetect_dep = dependency('opencv', version : ['>= 2.3.0'], required : true)
+facedetect_dep = dependency('opencv4', version : ['>= 4.0.0'], required : false)
+if not facedetect_dep.found()
+ facedetect_dep = dependency('opencv', version : ['>= 3.4.0'], required : true)
+endif
executable('shotwell-facedetect',
'shotwell-facedetect.cpp',
dependencies : facedetect_dep,
diff --git a/facedetect/shotwell-facedetect.cpp b/facedetect/shotwell-facedetect.cpp
index 1b09379..1c10580 100644
--- a/facedetect/shotwell-facedetect.cpp
+++ b/facedetect/shotwell-facedetect.cpp
@@ -34,7 +34,7 @@ void help() {
void detectFaces(Mat &img, CascadeClassifier &cascade, double scale) {
Mat gray;
- cvtColor(img, gray, CV_BGR2GRAY);
+ cvtColor(img, gray, cv::COLOR_BGR2GRAY);
Mat smallImg(cvRound(img.rows / scale), cvRound(img.cols / scale), CV_8UC1);
Size smallImgSize = smallImg.size();
@@ -43,7 +43,7 @@ void detectFaces(Mat &img, CascadeClassifier &cascade, double scale) {
equalizeHist(smallImg, smallImg);
vector<Rect> faces;
- cascade.detectMultiScale(smallImg, faces, 1.1, 2, CV_HAAR_SCALE_IMAGE, Size(30, 30));
+ cascade.detectMultiScale(smallImg, faces, 1.1, 2, cv::CASCADE_SCALE_IMAGE, Size(30, 30));
int i = 0;
for (vector<Rect>::const_iterator r = faces.begin(); r != faces.end(); r++, i++) {
@@ -117,7 +117,7 @@ int main(int argc, const char** argv) {
}
- Mat image = imread(inputName, 1);
+ Mat image = cv::imread(inputName, 1);
if (image.empty()) {
diff --git a/flatpak/org.gnome.Shotwell.json b/flatpak/org.gnome.Shotwell.json
index 47037c7..d79226f 100644
--- a/flatpak/org.gnome.Shotwell.json
+++ b/flatpak/org.gnome.Shotwell.json
@@ -2,12 +2,15 @@
"app-id": "org.gnome.Shotwell",
"runtime": "org.gnome.Platform",
"runtime-version": "41",
- "branch": "stable",
+ "branch": "testing",
"sdk": "org.gnome.Sdk",
"command" : "shotwell",
"rename-desktop-file" : "shotwell.desktop",
"rename-icon" : "shotwell",
"rename-appdata-file" : "shotwell.appdata.xml",
+ "tags" : [
+ "testing"
+ ],
"finish-args": [
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
"--filesystem=~/.config/dconf:ro",
@@ -137,7 +140,7 @@
},
{
"type": "patch",
- "path": "libraw-pkgconfig.patch"
+ "path": "patches/libraw-pkgconfig.patch"
}
]
},
diff --git a/flatpak/patches/libraw-pkgconfig.patch b/flatpak/patches/libraw-pkgconfig.patch
index 8ef671a..5b60b03 100644
--- a/flatpak/patches/libraw-pkgconfig.patch
+++ b/flatpak/patches/libraw-pkgconfig.patch
@@ -1,20 +1,7 @@
-From bf4b0b6a3ec1579916475295ac42a5f98559a04b Mon Sep 17 00:00:00 2001
-From: Emmanuele Bassi <ebassi@gnome.org>
-Date: Fri, 12 Feb 2016 18:29:35 +0000
-Subject: [PATCH] Add pkg-config file to LibRaw
-
-Taken from the Fedora package.
----
- libraw.pc.in | 5 +++--
- libraw_r.pc.in | 5 +++--
- 2 files changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/libraw.pc.in b/libraw.pc.in
-index 0e530b2..0c635f0 100644
---- a/libraw.pc.in
-+++ b/libraw.pc.in
-@@ -5,7 +5,8 @@ includedir=@includedir@
-
+--- LibRaw-0.20-Beta1/libraw.pc.in~ 2020-05-13 14:22:12.656424311 +0200
++++ LibRaw-0.20-Beta1/libraw.pc.in 2020-05-13 14:22:27.481441569 +0200
+@@ -5,7 +5,8 @@
+
Name: libraw
Description: Raw image decoder library (non-thread-safe)
-Requires: @PACKAGE_REQUIRES@
@@ -23,13 +10,11 @@ index 0e530b2..0c635f0 100644
-Libs: -L${libdir} -lraw -lstdc++@PC_OPENMP@
+Libs: -L${libdir} -lraw@PC_OPENMP@
+Libs.private: -lstdc++
- Cflags: -I${includedir}/libraw
-diff --git a/libraw_r.pc.in b/libraw_r.pc.in
-index a7f4535..c4e6028 100644
---- a/libraw_r.pc.in
-+++ b/libraw_r.pc.in
-@@ -5,7 +5,8 @@ includedir=@includedir@
-
+ Cflags: -I${includedir}/libraw -I${includedir}
+--- LibRaw-0.20-Beta1/libraw_r.pc.in~ 2020-05-13 14:22:18.034430572 +0200
++++ LibRaw-0.20-Beta1/libraw_r.pc.in 2020-05-13 14:22:27.481441569 +0200
+@@ -5,7 +5,8 @@
+
Name: libraw
Description: Raw image decoder library (thread-safe)
-Requires: @PACKAGE_REQUIRES@
@@ -38,6 +23,4 @@ index a7f4535..c4e6028 100644
-Libs: -L${libdir} -lraw_r -lstdc++@PC_OPENMP@
+Libs: -L${libdir} -lraw_r@PC_OPENMP@
+Libs.private: -lstdc++
- Cflags: -I${includedir}/libraw
---
-2.5.0
+ Cflags: -I${includedir}/libraw -I${includedir}
diff --git a/meson.build b/meson.build
index a5f9061..acbe821 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('shotwell', ['vala', 'c'],
- version : '0.30.15',
+ version : '0.30.16',
meson_version : '>= 0.43.0',
default_options : ['buildtype=debugoptimized'])
@@ -12,7 +12,7 @@ conf.set('_VERSION', '"@0@"'.format(meson.project_version()))
conf.set('_PREFIX', '"@0@"'.format(get_option('prefix')))
conf.set('_LANG_SUPPORT_DIR', '"@0@"'.format(join_paths(get_option('prefix'), get_option('localedir'))))
conf.set('_LIBEXECDIR', '"@0@"'.format(join_paths(get_option('prefix'), get_option('libexecdir'))))
-conf.set('_LIB', '"@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'))))
+conf.set('_LIB', '"@0@"'.format(get_option('libdir')))
configure_file(output : 'config.h', configuration: conf)
config_incdir = include_directories('.')
@@ -96,7 +96,7 @@ if get_option('udev') and gudev.found()
endif
if get_option('face-detection')
- add_global_arguments(['--define=ENABLE_FACES'], language : 'vala')
+ add_global_arguments(['--define=ENABLE_FACE_DETECTION'], language : 'vala')
subdir('facedetect')
endif
diff --git a/misc/shotwell.appdata.xml.in b/misc/shotwell.appdata.xml.in
index 8052f56..a14da62 100644
--- a/misc/shotwell.appdata.xml.in
+++ b/misc/shotwell.appdata.xml.in
@@ -54,6 +54,8 @@
<url type="bugtracker">https://gitlab.gnome.org/GNOME/shotwell/issues</url>
<releases>
+ <release version="0.30.16" date="2022-05-18" urgency="medium" type="stable" />
+ <release version="0.30.15" date="2022-04-04" urgency="medium" type="stable" />
<release version="0.30.14" date="2021-08-18" urgency="high" type="stable" />
<release version="0.30.13" date="2021-08-17" urgency="low" type="stable" />
<release version="0.30.12" date="2021-05-24" urgency="medium" type="stable" />
diff --git a/src/AppDirs.vala b/src/AppDirs.vala
index 74b045f..6c4541c 100644
--- a/src/AppDirs.vala
+++ b/src/AppDirs.vala
@@ -258,14 +258,12 @@ class AppDirs {
return subdir;
}
-#if ENABLE_FACES
public static File get_resources_dir() {
File? install_dir = get_install_dir();
return (install_dir != null) ? install_dir.get_child("share").get_child("shotwell")
: get_exec_dir();
}
-#endif
public static File get_lib_dir() {
File? install_dir = get_install_dir();
@@ -329,7 +327,6 @@ class AppDirs {
return f;
}
-#if ENABLE_FACES
public static File get_facedetect_bin() {
const string filename = "shotwell-facedetect";
File f = AppDirs.get_libexec_dir().get_parent().get_child("facedetect").get_child (filename);
@@ -346,7 +343,6 @@ class AppDirs {
}
return get_resources_dir().get_child("facedetect-haarcascade.xml");
}
-#endif
}
diff --git a/src/Commands.vala b/src/Commands.vala
index 2b9eac1..589ae38 100644
--- a/src/Commands.vala
+++ b/src/Commands.vala
@@ -2507,7 +2507,6 @@ public class FlagUnflagCommand : MultipleDataSourceAtOnceCommand {
}
}
-#if ENABLE_FACES
public class RemoveFacesFromPhotosCommand : SimpleProxyableCommand {
private Gee.Map<MediaSource, string> map_source_geometry = new Gee.HashMap<MediaSource, string>();
@@ -2721,5 +2720,3 @@ public class ModifyFacesCommand : SingleDataSourceCommand {
get_command_manager().reset();
}
}
-
-#endif
diff --git a/src/Dialogs.vala b/src/Dialogs.vala
index dc9f5a0..c4e4f3d 100644
--- a/src/Dialogs.vala
+++ b/src/Dialogs.vala
@@ -46,8 +46,6 @@ public bool confirm_warn_developer_changed(int number) {
return response == Gtk.ResponseType.YES;
}
-#if ENABLE_FACES
-
public bool confirm_delete_face(Face face) {
int count = face.get_sources_count();
string msg = ngettext(
@@ -59,8 +57,6 @@ public bool confirm_delete_face(Face face) {
Resources.DELETE_FACE_TITLE);
}
-#endif
-
}
namespace ExportUI {
diff --git a/src/Photo.vala b/src/Photo.vala
index 41b6f1d..b67457e 100644
--- a/src/Photo.vala
+++ b/src/Photo.vala
@@ -5209,7 +5209,6 @@ public class LibraryPhoto : Photo, Flaggable, Monitorable {
}
}
-#if ENABLE_FACES
// Attach faces.
Gee.Collection<Face>? faces = Face.global.fetch_for_source(this);
if (faces != null) {
@@ -5223,7 +5222,6 @@ public class LibraryPhoto : Photo, Flaggable, Monitorable {
}
}
}
-#endif
return dupe;
}
diff --git a/src/PhotoPage.vala b/src/PhotoPage.vala
index bced0ea..fd513b2 100644
--- a/src/PhotoPage.vala
+++ b/src/PhotoPage.vala
@@ -396,9 +396,7 @@ public abstract class EditingHostPage : SinglePhotoPage {
private Gtk.ToggleToolButton redeye_button = null;
private Gtk.ToggleToolButton adjust_button = null;
private Gtk.ToggleToolButton straighten_button = null;
-#if ENABLE_FACES
private Gtk.ToggleToolButton faces_button = null;
-#endif
private Gtk.ToolButton enhance_button = null;
private Gtk.Scale zoom_slider = null;
private Gtk.ToolButton prev_button = new Gtk.ToolButton(null, Resources.PREVIOUS_LABEL);
@@ -491,12 +489,10 @@ public abstract class EditingHostPage : SinglePhotoPage {
enhance_button.is_important = true;
toolbar.insert(enhance_button, -1);
-#if ENABLE_FACES
// faces tool
insert_faces_button(toolbar);
faces_button = new Gtk.ToggleToolButton();
//face_button
-#endif
// separator to force next/prev buttons to right side of toolbar
Gtk.SeparatorToolItem separator = new Gtk.SeparatorToolItem();
@@ -2357,9 +2353,7 @@ public class LibraryPhotoPage : EditingHostPage {
}
}
-#if ENABLE_FACES
private Gtk.ToggleToolButton faces_button = null;
-#endif
private CollectionPage? return_page = null;
private bool return_to_collection_on_release = false;
private LibraryPhotoPageViewFilter filter = new LibraryPhotoPageViewFilter();
@@ -3168,7 +3162,6 @@ public class LibraryPhotoPage : EditingHostPage {
get_command_manager().execute(new ModifyTagsCommand(photo, new_tags));
}
-#if ENABLE_FACES
private void on_faces_toggled() {
on_tool_button_toggled(faces_button, FacesTool.factory);
}
@@ -3186,6 +3179,5 @@ public class LibraryPhotoPage : EditingHostPage {
faces_button.is_important = true;
toolbar.insert(faces_button, -1);
}
-#endif
}
diff --git a/src/Resources.vala b/src/Resources.vala
index f9fa875..b65ec52 100644
--- a/src/Resources.vala
+++ b/src/Resources.vala
@@ -390,7 +390,6 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
return _("Delete Search “%s”").printf(name);
}
-#if ENABLE_FACES
public static string rename_face_exists_message(string name) {
return _("Unable to rename face to “%s” because the face already exists.").printf(name);
}
@@ -420,7 +419,6 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
public string delete_face_label(string name) {
return _("Delete Face “%s”").printf(name);
}
-#endif
private unowned string rating_label(Rating rating) {
switch (rating) {
diff --git a/src/SearchFilter.vala b/src/SearchFilter.vala
index bad6a73..ad8b7ec 100644
--- a/src/SearchFilter.vala
+++ b/src/SearchFilter.vala
@@ -223,9 +223,7 @@ public abstract class DefaultSearchViewFilter : SearchViewFilter {
Gee.List<Tag>? tags = Tag.global.fetch_for_source(source);
int tags_size = (tags != null) ? tags.size : 0;
-#if ENABLE_FACES
Gee.List<Face>? faces = Face.global.fetch_for_source(source);
-#endif
foreach (unowned string word in get_search_filter_words()) {
if (media_keywords != null && media_keywords.contains(word))
@@ -249,7 +247,6 @@ public abstract class DefaultSearchViewFilter : SearchViewFilter {
continue;
}
-#if ENABLE_FACES
if (faces != null) {
bool found = false;
foreach (Face f in faces) {
@@ -264,7 +261,7 @@ public abstract class DefaultSearchViewFilter : SearchViewFilter {
if (found)
continue;
}
-#endif
+
// failed all tests (this even works if none of the Indexables have strings,
// as they fail the implicit AND test)
return false;
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index 1e50777..84d7cbe 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -1252,6 +1252,10 @@ public class ImportPage : CheckerboardPage {
enumerate_files(fsid, "/PRIVATE/SONY", import_list);
got_well_known_dir = true;
}
+ if (check_directory_exists(fsid, "/PRIVATE/M4ROOT/", "CLIP")) {
+ enumerate_files(fsid, "/PRIVATE/M4ROOT/CLIP", import_list);
+ got_well_known_dir = true;
+ }
if (check_directory_exists(fsid, "/private/", "sony")) {
enumerate_files(fsid, "/private/sony", import_list);
got_well_known_dir = true;
diff --git a/src/config/GSettingsEngine.vala b/src/config/GSettingsEngine.vala
index a3d4e04..53c4e3f 100644
--- a/src/config/GSettingsEngine.vala
+++ b/src/config/GSettingsEngine.vala
@@ -357,6 +357,13 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
converted_val = "file://" + val;
}
+ try {
+ if (p == ConfigurableProperty.DESKTOP_BACKGROUND_FILE) {
+ set_gs_string(schema_names[p], key_names[p] + "-dark", converted_val);
+ }
+ } catch (Error error) {
+ // Do nothing, the setting does not exist (yet)
+ }
set_gs_string(schema_names[p], key_names[p], converted_val);
property_changed(p);
}
diff --git a/src/db/FaceLocationTable.vala b/src/db/FaceLocationTable.vala
index 14fef4c..8398616 100644
--- a/src/db/FaceLocationTable.vala
+++ b/src/db/FaceLocationTable.vala
@@ -4,8 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
-
public struct FaceLocationID {
public const int64 INVALID = -1;
@@ -198,5 +196,3 @@ public class FaceLocationTable : DatabaseTable {
throw_error("FaceLocationTable.update_face_location_serialized_geometry", res);
}
}
-
-#endif
diff --git a/src/db/FaceTable.vala b/src/db/FaceTable.vala
index a6e0bad..4836910 100644
--- a/src/db/FaceTable.vala
+++ b/src/db/FaceTable.vala
@@ -4,7 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
public struct FaceID {
public const int64 INVALID = -1;
@@ -166,4 +165,3 @@ public class FaceTable : DatabaseTable {
update_text_by_id_2(face_id.id, "name", new_name);
}
}
-#endif
diff --git a/src/dialogs/AdjustDateTimeDialog.vala b/src/dialogs/AdjustDateTimeDialog.vala
index 9ca41d6..fc08a3f 100644
--- a/src/dialogs/AdjustDateTimeDialog.vala
+++ b/src/dialogs/AdjustDateTimeDialog.vala
@@ -102,7 +102,7 @@ public class AdjustDateTimeDialog : Gtk.Dialog {
batch_radio_button.sensitive = display_options && photo_count > 1;
batch_radio_button.toggled.connect(on_time_changed);
- if (contains_video) {
+ if (!contains_video) {
var text = ngettext ("_Modify original photo file", "_Modify original photo files",
photo_count);
modify_originals_check_button = new Gtk.CheckButton.with_mnemonic(text);
diff --git a/src/faces/Face.vala b/src/faces/Face.vala
index 9be33c9..9304023 100644
--- a/src/faces/Face.vala
+++ b/src/faces/Face.vala
@@ -4,7 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
public class FaceSourceCollection : ContainerSourceCollection {
private Gee.HashMap<string, Face> name_map = new Gee.HashMap<string, Face>
((Gee.HashDataFunc)Face.hash_name_string, (Gee.EqualDataFunc)Face.equal_name_strings);
@@ -677,5 +676,3 @@ public class Face : DataSource, ContainerSource, Proxyable, Indexable {
base.destroy();
}
}
-
-#endif
diff --git a/src/faces/FaceLocation.vala b/src/faces/FaceLocation.vala
index cc5c4cf..e143b2e 100644
--- a/src/faces/FaceLocation.vala
+++ b/src/faces/FaceLocation.vala
@@ -4,8 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
-
public class FaceLocation : Object {
private static Gee.Map<FaceID?, Gee.Map<PhotoID?, FaceLocation>> face_photos_map;
@@ -205,5 +203,3 @@ public class FaceLocation : Object {
this.geometry = geometry;
}
}
-
-#endif
diff --git a/src/faces/FacePage.vala b/src/faces/FacePage.vala
index 41d1cef..f2512d5 100644
--- a/src/faces/FacePage.vala
+++ b/src/faces/FacePage.vala
@@ -4,8 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
-
public class FacePage : CollectionPage {
private Face face;
@@ -123,5 +121,3 @@ public class FacePage : CollectionPage {
}
}
}
-
-#endif
diff --git a/src/faces/FaceShape.vala b/src/faces/FaceShape.vala
index 21e85a9..1ff01fd 100644
--- a/src/faces/FaceShape.vala
+++ b/src/faces/FaceShape.vala
@@ -4,8 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
-
public abstract class FaceShape : Object {
public const string SHAPE_TYPE = null;
@@ -779,5 +777,3 @@ public class FaceRectangle : FaceShape {
return Math.sqrt((center_x - x) * (center_x - x) + (center_y - y) * (center_y - y));
}
}
-
-#endif
diff --git a/src/faces/Faces.vala b/src/faces/Faces.vala
index 3f0623a..595c3b6 100644
--- a/src/faces/Faces.vala
+++ b/src/faces/Faces.vala
@@ -4,8 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
-
namespace Faces {
public void init() throws Error {
@@ -17,21 +15,3 @@ public void terminate() {
}
}
-
-#else
-
-namespace Faces {
-
-public void init() throws Error {
- // do nothing; this method is here only
- // to make the unitizing mechanism happy
-}
-
-public void terminate() {
- // do nothing; this method is here only
- // to make the unitizing mechanism happy
-}
-
-}
-
-#endif
diff --git a/src/faces/FacesBranch.vala b/src/faces/FacesBranch.vala
index 1eb25cf..42fd921 100644
--- a/src/faces/FacesBranch.vala
+++ b/src/faces/FacesBranch.vala
@@ -4,8 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
-
public class Faces.Branch : Sidebar.Branch {
private Gee.HashMap<Face, Faces.SidebarEntry> entry_map = new Gee.HashMap<Face, Faces.SidebarEntry>();
@@ -142,5 +140,3 @@ public class Faces.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.RenameableEnt
AppWindow.get_command_manager().execute(new DeleteFaceCommand(face));
}
}
-
-#endif
diff --git a/src/faces/FacesTool.vala b/src/faces/FacesTool.vala
index cf53736..9803787 100644
--- a/src/faces/FacesTool.vala
+++ b/src/faces/FacesTool.vala
@@ -4,7 +4,6 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-#if ENABLE_FACES
public errordomain FaceShapeError {
CANT_CREATE
}
@@ -155,7 +154,9 @@ public class FacesTool : EditingTools.EditingTool {
help_layout.pack_start(help_text, true);
response_layout = new Gtk.Box(Gtk.Orientation.HORIZONTAL, CONTROL_SPACING);
+ #if ENABLE_FACE_DETECTION
response_layout.add(detection_button);
+ #endif
response_layout.add(cancel_button);
response_layout.add(ok_button);
@@ -348,10 +349,12 @@ public class FacesTool : EditingTools.EditingTool {
if (line.length == 0)
continue;
+ debug("shotwell-facedetect: %s", line);
+
string[] type_and_serialized = line.split(";");
if (type_and_serialized.length != 2) {
- critical("Wrong serialized line in face detection program output.");
- assert_not_reached();
+ // Pass on external helper log output as our debug log
+ continue;
}
switch (type_and_serialized[0]) {
@@ -373,7 +376,7 @@ public class FacesTool : EditingTools.EditingTool {
assert_not_reached();
default:
- assert_not_reached();
+ break;
}
}
}
@@ -973,5 +976,3 @@ public class FacesTool : EditingTools.EditingTool {
face_detection.cancel();
}
}
-
-#endif
diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala
index 99a1c67..3aa397e 100644
--- a/src/library/LibraryWindow.vala
+++ b/src/library/LibraryWindow.vala
@@ -48,9 +48,7 @@ public class LibraryWindow : AppWindow {
EVENTS,
IMPORT_ROLL,
FOLDERS,
-#if ENABLE_FACES
FACES,
-#endif
TAGS
}
@@ -115,9 +113,7 @@ public class LibraryWindow : AppWindow {
private Library.Branch library_branch = new Library.Branch();
private Tags.Branch tags_branch = new Tags.Branch();
private Folders.Branch folders_branch = new Folders.Branch();
-#if ENABLE_FACES
private Faces.Branch faces_branch = new Faces.Branch();
-#endif
private Events.Branch events_branch = new Events.Branch();
private Camera.Branch camera_branch = new Camera.Branch();
private Searches.Branch saved_search_branch = new Searches.Branch();
@@ -176,10 +172,7 @@ public class LibraryWindow : AppWindow {
sidebar_tree.graft(library_branch, SidebarRootPosition.LIBRARY);
sidebar_tree.graft(tags_branch, SidebarRootPosition.TAGS);
sidebar_tree.graft(folders_branch, SidebarRootPosition.FOLDERS);
-#if ENABLE_FACES
sidebar_tree.graft(faces_branch, SidebarRootPosition.FACES);
-#endif
-
sidebar_tree.graft(events_branch, SidebarRootPosition.EVENTS);
sidebar_tree.graft(camera_branch, SidebarRootPosition.CAMERAS);
sidebar_tree.graft(saved_search_branch, SidebarRootPosition.SAVED_SEARCH);
@@ -414,7 +407,6 @@ public class LibraryWindow : AppWindow {
debug("No search entry found for rename");
}
-#if ENABLE_FACES
public void rename_face_in_sidebar(Face face) {
Faces.SidebarEntry? entry = faces_branch.get_entry_for_face(face);
if (entry != null)
@@ -422,7 +414,6 @@ public class LibraryWindow : AppWindow {
else
assert_not_reached();
}
-#endif
protected override void on_quit() {
Config.Facade.get_instance().set_library_window_state(maximized, dimensions);
diff --git a/src/main.vala b/src/main.vala
index a971f15..d0cb246 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -99,10 +99,8 @@ void library_exec(string[] mounts) {
+ EventTable.get_instance().get_row_count()
+ TagTable.get_instance().get_row_count()
+ VideoTable.get_instance().get_row_count()
-#if ENABLE_FACES
+ FaceTable.get_instance().get_row_count()
+ FaceLocationTable.get_instance().get_row_count()
-#endif
+ Upgrades.get_instance().get_step_count();
if (grand_total > 5000) {
progress_dialog = new ProgressDialog(null, _("Loading Shotwell"));
@@ -146,14 +144,12 @@ void library_exec(string[] mounts) {
if (aggregate_monitor != null)
aggregate_monitor.next_step("Tag.init");
Tag.init(monitor);
-#if ENABLE_FACES
if (aggregate_monitor != null)
aggregate_monitor.next_step("FaceLocation.init");
FaceLocation.init(monitor);
if (aggregate_monitor != null)
aggregate_monitor.next_step("Face.init");
Face.init(monitor);
-#endif
MetadataWriter.init();
DesktopIntegration.init();
@@ -219,10 +215,8 @@ void library_exec(string[] mounts) {
Tombstone.terminate();
ThumbnailCache.terminate();
Video.terminate();
-#if ENABLE_FACES
Face.terminate();
FaceLocation.terminate();
-#endif
Library.app_terminate();
}
diff --git a/src/meson.build b/src/meson.build
index 530d6af..cc99f56 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -17,9 +17,7 @@ processor = executable('shotwell-graphics-processor',
dependencies: [gio, gdk, gee],
link_with: sw_graphics_processor)
-face_sources = []
-if get_option('face-detection')
- face_sources = (['faces/FacesBranch.vala',
+face_sources = (['faces/FacesBranch.vala',
'faces/FaceLocation.vala',
'faces/FacePage.vala',
'faces/FaceShape.vala',
@@ -28,7 +26,6 @@ if get_option('face-detection')
'db/FaceLocationTable.vala',
'db/FaceTable.vala',
'faces/FacesTool.vala'])
-endif
shotwell_deps = [gio, gee, sqlite, gtk, sqlite, posix, gphoto2,
gstreamer_pbu, gio_unix, gudev, gexiv2, gmodule,
diff --git a/src/searches/SavedSearchDialog.vala b/src/searches/SavedSearchDialog.vala
index f5558bf..526da35 100644
--- a/src/searches/SavedSearchDialog.vala
+++ b/src/searches/SavedSearchDialog.vala
@@ -79,9 +79,7 @@ public class SavedSearchDialog : Gtk.Dialog {
case SearchCondition.SearchType.ANY_TEXT:
case SearchCondition.SearchType.EVENT_NAME:
case SearchCondition.SearchType.FILE_NAME:
-#if ENABLE_FACES
case SearchCondition.SearchType.FACE:
-#endif
case SearchCondition.SearchType.TAG:
case SearchCondition.SearchType.COMMENT:
case SearchCondition.SearchType.TITLE:
diff --git a/src/searches/SearchBoolean.vala b/src/searches/SearchBoolean.vala
index 2be8302..5e69e57 100644
--- a/src/searches/SearchBoolean.vala
+++ b/src/searches/SearchBoolean.vala
@@ -52,9 +52,7 @@ public abstract class SearchCondition {
TAG,
EVENT_NAME,
FILE_NAME,
-#if ENABLE_FACES
FACE,
-#endif
MEDIA_TYPE,
FLAG_STATE,
MODIFIED_STATE,
@@ -65,9 +63,7 @@ public abstract class SearchCondition {
public static SearchType[] as_array() {
return { ANY_TEXT, TITLE, TAG, COMMENT, EVENT_NAME, FILE_NAME,
-#if ENABLE_FACES
FACE,
-#endif
MEDIA_TYPE, FLAG_STATE, MODIFIED_STATE, RATING, DATE };
}
@@ -98,10 +94,10 @@ public abstract class SearchCondition {
case SearchType.FILE_NAME:
return "FILE_NAME";
-#if ENABLE_FACES
+
case SearchType.FACE:
return "FACE";
-#endif
+
case SearchType.MEDIA_TYPE:
return "MEDIA_TYPE";
@@ -140,10 +136,10 @@ public abstract class SearchCondition {
else if (str == "FILE_NAME")
return SearchType.FILE_NAME;
-#if ENABLE_FACES
+
else if (str == "FACE")
return SearchType.FACE;
-#endif
+
else if (str == "MEDIA_TYPE")
return SearchType.MEDIA_TYPE;
@@ -182,10 +178,10 @@ public abstract class SearchCondition {
case SearchType.FILE_NAME:
return _("File name");
-#if ENABLE_FACES
+
case SearchType.FACE:
return _("Face");
-#endif
+
case SearchType.MEDIA_TYPE:
return _("Media type");
@@ -361,7 +357,6 @@ public class SearchConditionText : SearchCondition {
ret |= string_match(text, String.remove_diacritics(source.get_basename().down()));
}
-#if ENABLE_FACES
if (SearchType.ANY_TEXT == search_type || SearchType.FACE == search_type) {
Gee.List<Face>? face_list = Face.global.fetch_for_source(source);
if (null != face_list) {
@@ -372,7 +367,6 @@ public class SearchConditionText : SearchCondition {
ret |= string_match(text, null); // for IS_NOT_SET
}
}
-#endif
return (context == Context.DOES_NOT_CONTAIN) ? !ret : ret;
}
diff --git a/src/util/ui.vala b/src/util/ui.vala
index 7e7348f..6d32738 100644
--- a/src/util/ui.vala
+++ b/src/util/ui.vala
@@ -86,7 +86,6 @@ public bool has_only_key_modifier(Gdk.ModifierType field, Gdk.ModifierType mask)
| Gdk.ModifierType.META_MASK)) == mask;
}
-#if ENABLE_FACES
bool is_pointer_over(Gdk.Window window) {
Gdk.DeviceManager? devmgr = window.get_display().get_device_manager();
if (devmgr == null) {
@@ -101,5 +100,4 @@ bool is_pointer_over(Gdk.Window window) {
return x >= 0 && y >= 0 && x < window.get_width() && y < window.get_height();
}
-#endif