summaryrefslogtreecommitdiff
path: root/src/AppDirs.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-09-30 14:09:32 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-09-30 14:09:32 +0200
commit0537caaf4af94a9ead8b292679f6b34c90b55e06 (patch)
tree6761cfdf959926be7af3147cf770e7f253390fe8 /src/AppDirs.vala
parenteca5837e235a356c8db9416bbbc13577db3e6f76 (diff)
parent5e9f4eea451a77ba3b93db3747841ed2bd969e9f (diff)
Update upstream source from tag 'upstream/0.30.1'
Update to upstream version '0.30.1' with Debian dir dc242531effff8d9c6fab093414edee28b403c6a
Diffstat (limited to 'src/AppDirs.vala')
-rw-r--r--src/AppDirs.vala34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/AppDirs.vala b/src/AppDirs.vala
index ffea859..74b045f 100644
--- a/src/AppDirs.vala
+++ b/src/AppDirs.vala
@@ -258,6 +258,15 @@ 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();
@@ -302,6 +311,11 @@ class AppDirs {
// If we're running installed.
f = AppDirs.get_libexec_dir () .get_child ("shotwell").get_child (filename);
}
+
+ if (!f.query_exists()) {
+ f = AppDirs.get_libexec_dir().get_parent().get_child("thumbnailer").get_child(filename);
+ }
+
return f;
}
@@ -314,5 +328,25 @@ 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);
+ if (!f.query_exists()) {
+ f = AppDirs.get_libexec_dir().get_child("shotwell").get_child(filename);
+ }
+ return f;
+ }
+
+ public static File get_haarcascade_file() {
+ File f = File.new_for_path(AppDirs.get_exec_dir().get_parent().get_parent().get_child("facedetect").get_child("facedetect-haarcascade.xml").get_path());
+ if (f.query_exists()) {//testing meson builddir
+ return f;
+ }
+ return get_resources_dir().get_child("facedetect-haarcascade.xml");
+ }
+#endif
+
}