tracker r2240 - in branches/indexer-split: . src/libtracker-db src/tracker-indexer



Author: mr
Date: Tue Sep 16 13:38:49 2008
New Revision: 2240
URL: http://svn.gnome.org/viewvc/tracker?rev=2240&view=rev

Log:
	* src/libtracker-db/tracker-db-interface.c:
	(_tracker_db_result_set_set_value): Always set GValue to the the
	column type before setting the GValue. This saves us checking if
	it was set in the first place and sometimes the column type set
	initially is not the same as the type we get returned. Which is
	what was causing the G_VALUE_HOLDS_INT (value) assertion (when we
	were trying to set a double for GetMetadataIDValueNumeric.

	* src/tracker-indexer/tracker-indexer-module.c:
	(tracker_indexer_module_file_get_uri): Don't spam warnings about
	not being able to get the basename and/or dirname. This happens
	all the time for the email module because we don't process ALL
	files, only summary files for IMAP (for example). This means that
	the module may return NULL for basename and dirname. We shouldn't
	error the situation as a result.

	* src/tracker-indexer/tracker-indexer.c: (item_delete),
	(should_index_file), (process_file): Don't try to check if we
	should index email files, instead just do it right now. Before it
	would spam critical warnings about files not existing in the
	database. Also, make the item_delete() debug more consistent with
	other functions and clearer too.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-db/tracker-db-interface.c
   branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c
   branches/indexer-split/src/tracker-indexer/tracker-indexer.c

Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface.c	(original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface.c	Tue Sep 16 13:38:49 2008
@@ -484,8 +484,8 @@
 	g_return_if_fail (column < priv->columns);
 
 	/* Assign a GType if it didn't have any */
-	if (G_UNLIKELY (priv->col_types[column] == 0))
-		priv->col_types[column] = G_VALUE_TYPE (value);
+	/* if (G_UNLIKELY (priv->col_types[column] == 0)) */
+	priv->col_types[column] = G_VALUE_TYPE (value);
 
 	row = g_ptr_array_index (priv->array, priv->current_row);
 

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c	Tue Sep 16 13:38:49 2008
@@ -146,8 +146,6 @@
 
 		return TRUE;
 	} else {
-		g_debug ("Could not get URI for '%s'", file->path);
-
 		g_free (tmp_dirname);
 		g_free (tmp_basename);
 

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer.c	Tue Sep 16 13:38:49 2008
@@ -1400,7 +1400,7 @@
 
 	service_type = tracker_module_config_get_index_service (info->module_name);
 
-	g_debug ("Deleting item:'%s/%s'", dirname, basename);
+	g_debug ("Deleting item:'%s'", info->file->path);
 
 	if (!service_type || !service_type[0]) {
 		gchar *name;
@@ -1426,7 +1426,9 @@
 	tracker_db_check_service (service_def, dirname, basename, &service_id, NULL);
 
 	if (service_id < 1) {
-		g_debug ("  Can not delete file, it doesnt exist in DB");
+		g_debug ("  File does not exist anyway "
+			 "(dirname:'%s', basename:'%s')",
+			 dirname, basename);
 		return;
 	}
 
@@ -1754,20 +1756,6 @@
 		return TRUE;
 	}
 
-	/* Here we do a quick check to see if this is an email URI or
-	 * not. For emails we don't check for the parent cache the
-	 * same way, we simply index it. If the first character is not
-	 * '/' then the path is usually something like:
-	 *
-	 *   email://1192717939 16218 20 petunia//INBOX;uid=(null)
-	 *
-	 * What we should do, is check the summary mtime to know if
-	 * we should index the content I think.
-	 */
-	if (info->file->path[0] != G_DIR_SEPARATOR) {
-		return TRUE;
-	}
-
 	/* So, if we are here, then the file or directory DID exist
 	 * in the database already. Now we need to check if the
 	 * parent directory mtime matches the mtime we have for it in
@@ -1926,9 +1914,31 @@
 						  &basename)) {
 		return TRUE;
 	}
-		
-	/* For normal files, we do some checks, for moves we don't need these */
-	if (G_LIKELY (!info->other_file)) {
+	
+	/* 
+	 * FIRST:
+	 * ======
+	 * We don't check if we should index files for MOVE events.
+	 *
+	 * SECOND: 
+	 * =======
+	 * Here we do a quick check to see if this is an email URI or
+	 * not. For emails we don't check if we should index them, we
+	 * always do since it is ONLY summary files we index and we
+	 * need to look at them to know if anything changed anyway.
+	 * The only improvement we could have here is an mtime check.
+	 * This is yet to do.
+	 *
+	 * The info->file->path is the REAL location. The dirname and
+	 * basename which are returned by the module are combined to
+	 * look like:
+	 *
+	 *   email://1192717939 16218 20 petunia//INBOX;uid=(null)
+	 *
+	 * We simply check the dirname[0] to make sure it isn't an
+	 * email based dirname.
+	 */
+	if (G_LIKELY (!info->other_file) && dirname[0] == G_DIR_SEPARATOR) {
 		if (!should_index_file (indexer, info, dirname, basename)) {
 			g_debug ("File is already up to date: '%s'", info->file->path);
 



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