diff --git a/src/mu-config.c b/src/mu-config.c index d7c2e5a5..023051b1 100644 --- a/src/mu-config.c +++ b/src/mu-config.c @@ -65,8 +65,8 @@ config_options_group_index (MuConfigOptions *opts) "top of the maildir", NULL}, {"reindex", 'r', 0, G_OPTION_ARG_NONE, &opts->reindex, "index already indexed messages too", NULL}, - {"empty", 'y', 0, G_OPTION_ARG_NONE, &opts->empty, - "empty the database before indexing", NULL}, + {"rebuild", 'y', 0, G_OPTION_ARG_NONE, &opts->rebuild, + "rebuild the database from scratch", NULL}, {"autoupgrade", 'u', 0, G_OPTION_ARG_NONE, &opts->autoupgrade, "automatically upgrade the database with new mu versions", NULL}, {"nocleanup", 'n', 0, G_OPTION_ARG_NONE, &opts->nocleanup, diff --git a/src/mu-config.h b/src/mu-config.h index 995eb66b..b13fec7d 100644 --- a/src/mu-config.h +++ b/src/mu-config.h @@ -45,7 +45,7 @@ struct _MuConfigOptions { char *maildir; /* where the mails are */ gboolean nocleanup; /* don't cleanup deleted mails from db */ gboolean reindex; /* re-index existing mails */ - gboolean empty; /* empty the database before indexing */ + gboolean rebuild; /* empty the database before indexing */ gboolean autoupgrade; /* automatically upgrade db * when needed */ diff --git a/src/mu-index.c b/src/mu-index.c index 6ccd0869..70604024 100644 --- a/src/mu-index.c +++ b/src/mu-index.c @@ -93,8 +93,9 @@ typedef struct _MuIndexCallbackData MuIndexCallbackData; static MuResult -insert_or_update_maybe (const char* fullpath, time_t filestamp, - MuIndexCallbackData *data, gboolean *updated) +insert_or_update_maybe (const char* fullpath, const char* mdir, + time_t filestamp, + MuIndexCallbackData *data, gboolean *updated) { MuMsgGMime *msg; @@ -124,7 +125,7 @@ insert_or_update_maybe (const char* fullpath, time_t filestamp, } while (0); - msg = mu_msg_gmime_new (fullpath); + msg = mu_msg_gmime_new (fullpath, mdir); if (!msg) { g_warning ("%s: failed to create mu_msg for %s", __FUNCTION__, fullpath); @@ -161,8 +162,8 @@ run_msg_callback_maybe (MuIndexCallbackData *data) static MuResult -on_run_maildir_msg (const char* fullpath, time_t filestamp, - MuIndexCallbackData *data) +on_run_maildir_msg (const char* fullpath, const char* mdir, + time_t filestamp, MuIndexCallbackData *data) { MuResult result; gboolean updated; @@ -170,9 +171,9 @@ on_run_maildir_msg (const char* fullpath, time_t filestamp, result = run_msg_callback_maybe (data); if (result != MU_OK) return result; - + /* see if we need to update/insert anything...*/ - result = insert_or_update_maybe (fullpath, filestamp, data, + result = insert_or_update_maybe (fullpath, mdir, filestamp, data, &updated); /* update statistics */ @@ -298,7 +299,8 @@ mu_index_run (MuIndex *index, const char* path, } static MuResult -on_stats_maildir_file (const char *fullpath, time_t timestamp, +on_stats_maildir_file (const char *fullpath, const char* mdir, + time_t timestamp, MuIndexCallbackData *cb_data) { MuResult result;