summaryrefslogtreecommitdiff
path: root/tumblerd
diff options
context:
space:
mode:
authorAli Abdallah <aabdallah@suse.de>2020-05-01 13:21:39 +0200
committerAli Abdallah <aabdallah@suse.de>2020-05-01 13:39:12 +0200
commit3520322eb453ee1349b14b080a0f7d23e4040b16 (patch)
treed6acd0b797fe99d3a326b27e7426d3535c76c3bf /tumblerd
parent4626d3a97a04dab06925053ac5b80c6f7be5f2f2 (diff)
downloadtumbler-3520322eb453ee1349b14b080a0f7d23e4040b16.tar.gz
This commit implements Excludes paths
Any path found in a plugin Excludes will be ignored, code contributed by Markus Kolb xfce@tower-net.de Bug #16130.
Diffstat (limited to 'tumblerd')
-rw-r--r--tumblerd/main.c8
-rw-r--r--tumblerd/tumbler.rc16
2 files changed, 23 insertions, 1 deletions
diff --git a/tumblerd/main.c b/tumblerd/main.c
index 73b5af2..2c2d8da 100644
--- a/tumblerd/main.c
+++ b/tumblerd/main.c
@@ -249,6 +249,7 @@ main (int argc,
const gchar *type_name;
gchar **paths;
GSList *locations;
+ GSList *excludes;
/* set the program name */
g_set_prgname (G_LOG_DOMAIN);
@@ -322,10 +323,15 @@ main (int argc,
locations = locations_from_strv (paths);
g_strfreev (paths);
+ paths = g_key_file_get_string_list (rc, type_name, "Excludes", NULL, NULL);
+ excludes = locations_from_strv (paths);
+ g_strfreev (paths);
+
g_object_set (G_OBJECT (tp->data),
"priority", priority,
"max-file-size", file_size,
"locations", locations,
+ "excludes", excludes,
NULL);
/* ready for usage */
@@ -335,6 +341,8 @@ main (int argc,
g_object_unref (tp->data);
g_slist_foreach (locations, (GFunc) g_object_unref, NULL);
g_slist_free (locations);
+ g_slist_foreach (excludes, (GFunc) g_object_unref, NULL);
+ g_slist_free (excludes);
}
/* free the thumbnailer list */
diff --git a/tumblerd/tumbler.rc b/tumblerd/tumbler.rc
index 3e92911..dab6e33 100644
--- a/tumblerd/tumbler.rc
+++ b/tumblerd/tumbler.rc
@@ -10,6 +10,10 @@
# priority will be tried.
# Absolute paths, environement variables, ~/ and ~username/
# are allowed. Leave empty to allow all locations.
+# Excludes: ;-separated path list the plugin will not be used in.
+# Absolute paths, environement variables, ~/ and ~username/
+# are allowed. Leave empty to exclude nothing. Please note
+# that paths in Excludes precede those in Locations.
# MaxFileSize: Maximum size of the source file the plugin will still
# try to generate a plugin for. The size is in bytes,
# 0 disabled the check.
@@ -26,6 +30,7 @@
Disabled=false
Priority=3
Locations=
+Excludes=
MaxFileSize=209715200
# Supports all type GdkPixbuf supports
@@ -33,6 +38,7 @@ MaxFileSize=209715200
Disabled=false
Priority=2
Locations=
+Excludes=
MaxFileSize=209715200
# RAW image files using libopenraw
@@ -40,6 +46,7 @@ MaxFileSize=209715200
Disabled=false
Priority=1
Locations=
+Excludes=
MaxFileSize=209715200
###
@@ -53,6 +60,7 @@ MaxFileSize=209715200
Disabled=true
Priority=3
Locations=~/movies
+Excludes=
MaxFileSize=0
#APIKey=your-api-key-from-themoviedb.org
@@ -61,6 +69,7 @@ MaxFileSize=0
Disabled=false
Priority=2
Locations=
+Excludes=
MaxFileSize=2147483648
# GStreamer plugin
@@ -68,6 +77,7 @@ MaxFileSize=2147483648
Disabled=false
Priority=1
Locations=
+Excludes=
MaxFileSize=2147483648
###
@@ -79,6 +89,7 @@ MaxFileSize=2147483648
Disabled=false
Priority=1
Locations=
+Excludes=
MaxFileSize=209715200
@@ -87,6 +98,7 @@ MaxFileSize=209715200
Disabled=false
Priority=1
Locations=
+Excludes=
MaxFileSize=209715200
# Open document thumbnailer (ODF)
@@ -94,6 +106,7 @@ MaxFileSize=209715200
Disabled=false
Priority=1
Locations=
+Excludes=
MaxFileSize=209715200
# thumbnailers provided by .thumbnailer desktop files
@@ -101,4 +114,5 @@ MaxFileSize=209715200
Disabled=false
Priority=1
Locations=
-MaxFileSize=2147483648 \ No newline at end of file
+Excludes=
+MaxFileSize=2147483648