tracker r2961 - in trunk: . src/tracker-indexer
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2961 - in trunk: . src/tracker-indexer
- Date: Tue, 24 Feb 2009 16:02:00 +0000 (UTC)
Author: mr
Date: Tue Feb 24 16:02:00 2009
New Revision: 2961
URL: http://svn.gnome.org/viewvc/tracker?rev=2961&view=rev
Log:
* src/tracker-indexer/tracker-indexer.c: If we don't get an mtime
for a file, don't then just return, make sure it is removed from
the DB. Reduced debugging so we don't print twice that we aren't
changing the DB for each file. Improved function names and
debugging to make more sense. Fixes NB#98297 too.
Modified:
trunk/ChangeLog
trunk/src/tracker-indexer/tracker-indexer.c
Modified: trunk/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-indexer.c (original)
+++ trunk/src/tracker-indexer/tracker-indexer.c Tue Feb 24 16:02:00 2009
@@ -2106,10 +2106,10 @@
}
static gboolean
-should_index_file (TrackerIndexer *indexer,
- PathInfo *info,
- const gchar *dirname,
- const gchar *basename)
+should_change_index_for_file (TrackerIndexer *indexer,
+ PathInfo *info,
+ const gchar *dirname,
+ const gchar *basename)
{
TrackerService *service;
gchar *path;
@@ -2142,16 +2142,16 @@
path = g_file_get_path (info->file);
current_mtime = tracker_file_get_mtime (path);
- /* Don't attempt to index the file if we couldn't even get the
- * current mtime for it.
+ /* NOTE: We return TRUE here because we want to update the DB
+ * about this file, not because we want to index it.
*/
if (current_mtime == 0) {
g_free (path);
- return FALSE;
+ return TRUE;
}
if (current_mtime <= db_mtime) {
- g_debug ("'%s' has indifferent mtime and should not be indexed", path);
+ g_debug ("'%s' is already up to date in DB, not (re)indexing", path);
g_free (path);
return FALSE;
@@ -2221,20 +2221,17 @@
* email based dirname.
*/
if (G_LIKELY (!info->source_file) && dirname[0] == G_DIR_SEPARATOR) {
- if (!should_index_file (indexer, info, dirname, basename)) {
+ if (!should_change_index_for_file (indexer, info, dirname, basename)) {
gchar *path;
indexer->private->items_processed++;
path = g_file_get_path (info->file);
- g_debug ("File is already up to date: '%s'", path);
-
g_free (dirname);
g_free (basename);
g_free (path);
-
return TRUE;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]