[tracker] Integrate thumbnailer's Move and Remove with FS miner
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Integrate thumbnailer's Move and Remove with FS miner
- Date: Mon, 1 Feb 2010 16:05:40 +0000 (UTC)
commit 61436ff75e035682ac4fe240952fdd24522c25e5
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Feb 1 13:27:32 2010 +0100
Integrate thumbnailer's Move and Remove with FS miner
src/libtracker-miner/tracker-miner-fs.c | 23 ++++++++++++++++++++++-
src/libtracker-miner/tracker-thumbnailer.c | 10 ++++++++++
2 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 651d95c..1eb8b83 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -27,6 +27,7 @@
#include "tracker-miner-fs.h"
#include "tracker-monitor.h"
#include "tracker-utils.h"
+#include "tracker-thumbnailer.h"
/**
* SECTION:tracker-miner-fs
@@ -1067,6 +1068,7 @@ item_remove (TrackerMinerFS *fs,
GString *sparql;
gchar *uri, *slash_uri;
ProcessData *data;
+ GFileInfo *file_info;
uri = g_file_get_uri (file);
@@ -1079,6 +1081,15 @@ item_remove (TrackerMinerFS *fs,
return TRUE;
}
+ file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ NULL, NULL);
+
+ if (file_info) {
+ tracker_thumbnailer_remove_add (uri, g_file_info_get_content_type (file_info));
+ g_object_unref (file_info);
+ }
+
if (!g_str_has_suffix (uri, "/")) {
slash_uri = g_strconcat (uri, "/", NULL);
} else {
@@ -1326,7 +1337,8 @@ item_move (TrackerMinerFS *fs,
}
file_info = g_file_query_info (file,
- G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+ G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME ","
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
NULL, NULL);
@@ -1346,6 +1358,14 @@ item_move (TrackerMinerFS *fs,
source_uri,
uri);
+ /* TODO: Perhaps we should move this to item_update_uri_recursively, and
+ * that way support a directory being renamed too? I'm reluctant to add
+ * a file_info lookup to each kid in a (sub)directory, though */
+
+ tracker_thumbnailer_move_add (source_uri,
+ g_file_info_get_content_type (file_info),
+ uri);
+
sparql = g_string_new ("");
g_string_append_printf (sparql,
@@ -1543,6 +1563,7 @@ item_queue_handlers_cb (gpointer user_data)
process_stop (fs);
}
+ tracker_thumbnailer_send ();
/* No more files left to process */
keep_processing = FALSE;
break;
diff --git a/src/libtracker-miner/tracker-thumbnailer.c b/src/libtracker-miner/tracker-thumbnailer.c
index ddededf..4a85518 100644
--- a/src/libtracker-miner/tracker-thumbnailer.c
+++ b/src/libtracker-miner/tracker-thumbnailer.c
@@ -262,6 +262,11 @@ tracker_thumbnailer_move_add (const gchar *from_uri,
used_from_uri,
used_to_uri);
+ if ((g_slist_length (private->moves_from) +
+ g_slist_length (private->removes)) > 50) {
+ tracker_thumbnailer_send ();
+ }
+
return TRUE;
}
@@ -298,6 +303,11 @@ tracker_thumbnailer_remove_add (const gchar *uri,
g_debug ("Thumbnailer request to remove uri:'%s', appended to queue", uri);
+ if ((g_slist_length (private->moves_from) +
+ g_slist_length (private->removes)) > 50) {
+ tracker_thumbnailer_send ();
+ }
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]