* 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;
}
/* see we need to reindex the database */
index->_needs_reindex =
mu_util_xapian_db_version_up_to_date (xpath) ? FALSE : TRUE;
/* 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 =
mu_util_xapian_db_version_up_to_date (xpath) ? FALSE : TRUE;
}
return index;
}
@ -386,7 +392,6 @@ mu_index_cleanup (MuIndex *index, MuIndexStats *stats,
return rv;
}
gboolean
mu_index_stats_clear (MuIndexStats *stats)
{

View File

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