[tracker] Deal with directory renames for thumbnailer Move
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Deal with directory renames for thumbnailer Move
- Date: Tue, 2 Feb 2010 09:59:03 +0000 (UTC)
commit 17ed093223e18e9321ec275885ac050b8bc775fc
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Feb 2 10:58:19 2010 +0100
Deal with directory renames for thumbnailer Move
src/libtracker-miner/tracker-miner-fs.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 67af067..f3572ee 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1260,20 +1260,25 @@ item_update_uri_recursively_cb (GObject *object,
gint i;
for (i = 0; i < query_results->len; i++) {
- gchar **child_source_uri, *child_uri;
+ GStrv row;
+ gchar *child_source_uri, *child_uri, *child_mime;
- child_source_uri = g_ptr_array_index (query_results, i);
+ row = g_ptr_array_index (query_results, i);
+ child_source_uri = row[0];
+ child_mime = row[1];
- if (!g_str_has_prefix (*child_source_uri, data->source_uri)) {
+ if (!g_str_has_prefix (child_source_uri, data->source_uri)) {
g_warning ("Child URI '%s' does not start with parent URI '%s'",
- *child_source_uri,
+ child_source_uri,
data->source_uri);
continue;
}
- child_uri = g_strdup_printf ("%s%s", data->uri, *child_source_uri + strlen (data->source_uri));
+ child_uri = g_strdup_printf ("%s%s", data->uri, child_source_uri + strlen (data->source_uri));
- item_update_uri_recursively (fs, data, *child_source_uri, child_uri);
+ tracker_thumbnailer_move_add (child_source_uri, child_mime, child_uri);
+
+ item_update_uri_recursively (fs, data, child_source_uri, child_uri);
g_free (child_uri);
}
@@ -1307,11 +1312,12 @@ item_update_uri_recursively (TrackerMinerFS *fs,
"} ",
uri, source_uri);
- sparql = g_strdup_printf ("SELECT ?child WHERE { "
+ sparql = g_strdup_printf ("SELECT ?child ?m WHERE { "
" ?child nfo:belongsToContainer ?c . "
- " ?c nie:url '%s' "
+ " ?c nie:url '%s' . "
+ " OPTIONAL { ?child nie:mimeType ?m } "
"}",
- source_uri);
+ source_uri);
tracker_miner_execute_sparql (TRACKER_MINER (fs),
sparql,
@@ -1372,10 +1378,6 @@ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]