* mu-index.[ch]: minor changes

This commit is contained in:
Dirk-Jan C. Binnema
2010-01-31 12:13:06 +02:00
parent 8cbd6384a7
commit 8ed3eb9276
2 changed files with 12 additions and 4 deletions

View File

@ -54,9 +54,15 @@ mu_index_new (const char *xpath)
return NULL; return NULL;
} }
/* see we need to reindex the database */ /* see we need to reindex the database; note, there is a small race-condition
* here, between mu_index_new and mu_index_run. Maybe do the check in
* mu_index_run instead? */
if (mu_util_xapian_db_is_empty (xpath))
index->_needs_reindex = FALSE;
else {
index->_needs_reindex = index->_needs_reindex =
mu_util_xapian_db_version_up_to_date (xpath) ? FALSE : TRUE; mu_util_xapian_db_version_up_to_date (xpath) ? FALSE : TRUE;
}
return index; return index;
} }
@ -386,7 +392,6 @@ mu_index_cleanup (MuIndex *index, MuIndexStats *stats,
return rv; return rv;
} }
gboolean gboolean
mu_index_stats_clear (MuIndexStats *stats) mu_index_stats_clear (MuIndexStats *stats)
{ {

View File

@ -20,6 +20,9 @@
#ifndef __MU_INDEX_H__ #ifndef __MU_INDEX_H__
#define __MU_INDEX_H__ #define __MU_INDEX_H__
#include <stdlib.h>
#include <glib.h>
#include "mu-result.h" /* for MuResult */ #include "mu-result.h" /* for MuResult */
/* opaque structure */ /* opaque structure */