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



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

    tracker-extract, png: Ignore images in certain directories

 src/tracker-extract/tracker-extract-png.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index 262fadf..e409469 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -30,6 +30,9 @@
 #include <libtracker-common/tracker-date-time.h>
 #include <libtracker-extract/tracker-extract.h>
 
+#include "tracker-main.h"
+#include "tracker-config.h"
+
 #define RFC1123_DATE_FORMAT "%d %B %Y %H:%M:%S %z"
 #define CM_TO_INCH          0.393700787
 
@@ -708,7 +711,7 @@ guess_dlna_profile (gint          depth,
                     const gchar **dlna_profile,
                     const gchar **dlna_mimetype)
 {
-	gchar *profile = NULL;
+	const gchar *profile = NULL;
 
 	if (dlna_profile) {
 		*dlna_profile = NULL;
@@ -743,6 +746,13 @@ guess_dlna_profile (gint          depth,
 	return FALSE;
 }
 
+static gint
+path_is_in_path (gconstpointer a,
+                 gconstpointer b)
+{
+	return tracker_path_is_in_path (b, a) ? 0 : 1;
+}
+
 static void
 extract_png (const gchar          *uri,
              TrackerSparqlBuilder *preupdate,
@@ -768,6 +778,13 @@ extract_png (const gchar          *uri,
 		return;
 	}
 
+	if (g_slist_find_custom (tracker_config_get_ignore_images_under (
+	                            tracker_main_get_config()),
+	                         filename, path_is_in_path)) {
+		g_free (filename);
+		return;
+	}
+
 	f = tracker_file_open (filename);
 	g_free (filename);
 



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