[tracker/tracker-0.10-nb276745: 4/7] tracker-extract, icon: Ignore images in certain directories
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10-nb276745: 4/7] tracker-extract, icon: Ignore images in certain directories
- Date: Tue, 18 Oct 2011 14:37:26 +0000 (UTC)
commit 48cb712498e698783d6860413b22d57a436e4fd3
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Oct 18 12:22:18 2011 +0200
tracker-extract, icon: Ignore images in certain directories
src/tracker-extract/tracker-extract-icon.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-icon.c b/src/tracker-extract/tracker-extract-icon.c
index 0a6185f..a13d328 100644
--- a/src/tracker-extract/tracker-extract-icon.c
+++ b/src/tracker-extract/tracker-extract-icon.c
@@ -22,6 +22,9 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include "tracker-main.h"
+#include "tracker-config.h"
+
static void extract_icon (const gchar *filename,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata);
@@ -133,6 +136,13 @@ find_max_width_and_height (const gchar *uri,
return TRUE;
}
+static gint
+path_is_in_path (gconstpointer a,
+ gconstpointer b)
+{
+ return tracker_path_is_in_path (b, a) ? 0 : 1;
+}
+
static void
extract_icon (const gchar *uri,
TrackerSparqlBuilder *preupdate,
@@ -140,6 +150,18 @@ extract_icon (const gchar *uri,
{
guint max_width;
guint max_height;
+ gchar *filename;
+
+ filename = g_filename_from_uri (uri, NULL, NULL);
+
+ if (g_slist_find_custom (tracker_config_get_ignore_images_under (
+ tracker_main_get_config()),
+ filename, path_is_in_path)) {
+ g_free (filename);
+ return;
+ }
+
+ g_free (filename);
/* The Windows Icon file format may contain the same icon with different
* sizes inside, so there's no clear way of setting single width and
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]