Mercurial > dovecot > core-2.2
changeset 8508:689a63a99363 HEAD
fts: Hide "Searching .." notify while indexing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 30 Nov 2008 16:28:46 +0200 |
parents | f323bf2465bd |
children | 2eede4287841 |
files | src/lib-storage/index/index-search.c src/lib-storage/mail-storage-private.h src/plugins/fts/fts-storage.c |
diffstat | 3 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-search.c Sun Nov 30 15:57:41 2008 +0200 +++ b/src/lib-storage/index/index-search.c Sun Nov 30 16:28:46 2008 +0200 @@ -1074,7 +1074,8 @@ /* set the search time in here, in case a plugin already spent some time indexing the mailbox */ ctx->search_start_time = ioloop_timeval; - } else if (box->storage->callbacks->notify_ok != NULL) { + } else if (box->storage->callbacks->notify_ok != NULL && + !ctx->mail_ctx.progress_hidden) { percentage = ctx->mail_ctx.progress_cur * 100.0 / ctx->mail_ctx.progress_max; msecs = (ioloop_timeval.tv_sec -
--- a/src/lib-storage/mail-storage-private.h Sun Nov 30 15:57:41 2008 +0200 +++ b/src/lib-storage/mail-storage-private.h Sun Nov 30 16:28:46 2008 +0200 @@ -329,6 +329,7 @@ ARRAY_DEFINE(module_contexts, union mail_search_module_context *); unsigned int seen_lost_data:1; + unsigned int progress_hidden:1; }; struct mail_save_context {
--- a/src/plugins/fts/fts-storage.c Sun Nov 30 15:57:41 2008 +0200 +++ b/src/plugins/fts/fts-storage.c Sun Nov 30 16:28:46 2008 +0200 @@ -211,6 +211,7 @@ ctx->headers = str_new(default_pool, 512); ctx->mail = mail_alloc(t, 0, NULL); ctx->search_ctx = mailbox_search_init(t, search_args, NULL); + ctx->search_ctx->progress_hidden = TRUE; ctx->search_args = search_args; fctx->build_ctx = ctx; @@ -529,6 +530,7 @@ ctx->progress_max = array_count(&fctx->definite_seqs) + array_count(&fctx->maybe_seqs); } + ctx->progress_cur = 0; } static bool fts_try_build_init(struct mail_search_context *ctx, @@ -553,6 +555,9 @@ if (fctx->build_ctx == NULL) { /* the index was up to date */ fts_search_init_lookup(ctx, fctx); + } else { + /* hide "searching" notifications */ + ctx->progress_hidden = TRUE; } return TRUE; } @@ -611,6 +616,7 @@ } /* finished / error */ + ctx->progress_hidden = FALSE; if (fts_build_deinit(&fctx->build_ctx) < 0) ret = -1; if (ret > 0) {