* overhaul the configuration system (part 1)
This commit is contained in:
@ -32,39 +32,6 @@
|
||||
#include "mu-index.h"
|
||||
#include "mu-store-xapian.h"
|
||||
|
||||
struct _IndexOptions {
|
||||
gboolean quiet;
|
||||
gboolean cleanup;
|
||||
gboolean reindex;
|
||||
const char *maildir;
|
||||
};
|
||||
typedef struct _IndexOptions IndexOptions;
|
||||
|
||||
static IndexOptions INDEX_OPTIONS;
|
||||
static GOptionEntry INDEX_ENTRIES[] = {
|
||||
{"maildir", 'm', 0, G_OPTION_ARG_FILENAME, &INDEX_OPTIONS.maildir,
|
||||
"top of the maildir", NULL},
|
||||
|
||||
/* FIXME: implement this */
|
||||
{"reindex", 'r', 0, G_OPTION_ARG_NONE, &INDEX_OPTIONS.reindex,
|
||||
"re-index already indexed messages ", NULL},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
|
||||
GOptionGroup*
|
||||
mu_index_option_group (void)
|
||||
{
|
||||
GOptionGroup *og;
|
||||
|
||||
og = g_option_group_new ("index",
|
||||
"options for indexing your maildirs",
|
||||
"", NULL, NULL);
|
||||
|
||||
g_option_group_add_entries (og, INDEX_ENTRIES);
|
||||
|
||||
return og;
|
||||
}
|
||||
|
||||
|
||||
struct _MuIndex {
|
||||
@ -112,7 +79,7 @@ struct _MuIndexCallbackData {
|
||||
MuStoreXapian* _xapian;
|
||||
void* _user_data;
|
||||
MuIndexStats* _stats;
|
||||
gboolean _force;
|
||||
gboolean _reindex;
|
||||
time_t _dirstamp;
|
||||
};
|
||||
typedef struct _MuIndexCallbackData MuIndexCallbackData;
|
||||
@ -126,7 +93,7 @@ insert_or_update_maybe (const char* fullpath, time_t filestamp,
|
||||
*updated = FALSE;
|
||||
|
||||
if ((size_t)filestamp <= (size_t)data->_dirstamp) {
|
||||
if (!data->_force)
|
||||
if (!data->_reindex)
|
||||
return MU_OK;
|
||||
}
|
||||
|
||||
@ -239,7 +206,7 @@ check_path (const char* path)
|
||||
|
||||
MuResult
|
||||
mu_index_run (MuIndex *index, const char* path,
|
||||
gboolean force, MuIndexStats *stats,
|
||||
gboolean reindex, MuIndexStats *stats,
|
||||
MuIndexMsgCallback msg_cb, MuIndexDirCallback dir_cb,
|
||||
void *user_data)
|
||||
{
|
||||
@ -254,7 +221,7 @@ mu_index_run (MuIndex *index, const char* path,
|
||||
cb_data._user_data = user_data;
|
||||
cb_data._xapian = index->_xapian;
|
||||
cb_data._stats = stats;
|
||||
cb_data._force = force;
|
||||
cb_data._reindex = reindex;
|
||||
|
||||
cb_data._dirstamp = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user