[tracker/tracker-0.10-nb276745: 7/7] tracker-extract, tiff: Ignore images in certain directories



commit ea9fd7900d17623789dbd3a078dea213f965a706
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Oct 18 12:22:52 2011 +0200

    tracker-extract, tiff: Ignore images in certain directories

 src/tracker-extract/tracker-extract-tiff.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index d177c3c..001ae87 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -37,6 +37,9 @@
 #include <libtracker-common/tracker-common.h>
 #include <libtracker-extract/tracker-extract.h>
 
+#include "tracker-main.h"
+#include "tracker-config.h"
+
 #define CM_TO_INCH          0.393700787
 
 typedef enum {
@@ -294,6 +297,13 @@ extract_tiff (const gchar          *uri,
 
 	filename = g_filename_from_uri (uri, NULL, NULL);
 
+	if (g_slist_find_custom (tracker_config_get_ignore_images_under (
+	                            tracker_main_get_config()),
+	                         filename, (GCompareFunc) strstr)) {
+		g_free (filename);
+		return;
+	}
+
 	fd = g_open (filename, O_RDONLY | O_NOATIME, 0);
 	if (fd == -1 && errno == EPERM) {
 		fd = g_open (filename, O_RDONLY, 0);



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