[tracker/avoid-iri-cache-miss: 2/2] libtracker-miner: fix files without nfo:belongsToContainer during initial crawling



commit 6ff2a3caa4f37da7a4f9fabd600c38fe19f578be
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Sep 6 18:07:59 2010 +0200

    libtracker-miner: fix files without nfo:belongsToContainer during initial crawling

 src/libtracker-miner/tracker-miner-fs.c |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 8d9cd68..a00f583 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -112,7 +112,6 @@ struct _TrackerMinerFSPrivate {
 	GHashTable     *items_ignore_next_update;
 
 	GQuark          quark_ignore_file;
-	GQuark          quark_on_file_created;
 
 	GList          *config_directories;
 
@@ -560,8 +559,6 @@ tracker_miner_fs_init (TrackerMinerFS *object)
 	                  object);
 
 	priv->quark_ignore_file = g_quark_from_static_string ("tracker-ignore-file");
-	priv->quark_on_file_created =
-		g_quark_from_static_string ("tracker-on-file-created");
 
 	priv->iri_cache = g_hash_table_new_full (g_file_hash,
 	                                         (GEqualFunc) g_file_equal,
@@ -1541,7 +1538,6 @@ item_add_or_update (TrackerMinerFS *fs,
 	GFile *parent;
 	const gchar *urn;
 	const gchar *parent_urn = NULL;
-	gboolean just_created;
 
 	priv = fs->private;
 	retval = TRUE;
@@ -1550,11 +1546,6 @@ item_add_or_update (TrackerMinerFS *fs,
 	sparql = tracker_sparql_builder_new_update ();
 	g_object_ref (file);
 
-	/* Was the item just created? */
-	just_created = (g_object_steal_qdata (G_OBJECT (file),
-	                                      fs->private->quark_on_file_created) != NULL ?
-	                TRUE : FALSE);
-
 	parent = g_file_get_parent (file);
 
 	if (parent) {
@@ -1587,11 +1578,10 @@ item_add_or_update (TrackerMinerFS *fs,
 		g_object_unref (parent);
 	}
 
-	/* If the item was just created, force a direct URN query if not found
-	 * in the cache. This is to handle situations where an application inserted
-	 * items in the store after we updated the cache, or without a proper
-	 * nfo:belongsToContainer */
-	urn = iri_cache_lookup (fs, file, just_created);
+	/* Force a direct URN query if not found in the cache. This is to handle
+	 * situations where an application inserted items in the store after we
+	 * updated the cache, or without a proper nfo:belongsToContainer */
+	urn = iri_cache_lookup (fs, file, TRUE);
 
 	data = process_data_new (TRACKER_MINER (fs), file, urn, parent_urn, cancellable, sparql);
 	priv->processing_pool = g_list_prepend (priv->processing_pool, data);
@@ -2803,10 +2793,6 @@ monitor_item_created_cb (TrackerMonitor *monitor,
 		    should_recurse_for_directory (fs, file)) {
 			tracker_miner_fs_directory_add_internal (fs, file);
 		} else {
-			g_object_set_qdata (G_OBJECT (file),
-			                    fs->private->quark_on_file_created,
-			                    GINT_TO_POINTER (TRUE));
-
 			g_queue_push_tail (fs->private->items_created,
 			                   g_object_ref (file));
 



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