mirror of
https://github.com/djcb/mu.git
synced 2024-06-29 07:51:04 +02:00
* fix progress info display for indexing
This commit is contained in:
parent
12e6cd171a
commit
64985d7791
8
TODO
8
TODO
|
@ -8,7 +8,6 @@
|
||||||
- [ ] query on time
|
- [ ] query on time
|
||||||
- [ ] mu-setup (?)
|
- [ ] mu-setup (?)
|
||||||
- [ ] mu stats
|
- [ ] mu stats
|
||||||
- [ ] muex.7, man page with simple examples
|
|
||||||
- [ ] follow symlinks when indexing
|
- [ ] follow symlinks when indexing
|
||||||
- [ ] ansi-colors in output
|
- [ ] ansi-colors in output
|
||||||
- [ ] config system (config file) (?)
|
- [ ] config system (config file) (?)
|
||||||
|
@ -16,9 +15,9 @@
|
||||||
- [ ] detect mail threads (?)
|
- [ ] detect mail threads (?)
|
||||||
- [ ] clean up mu-msg-field, add formatting(?)
|
- [ ] clean up mu-msg-field, add formatting(?)
|
||||||
- [ ] xml,json,sexp output
|
- [ ] xml,json,sexp output
|
||||||
|
- [ ] completion for zsh
|
||||||
|
|
||||||
|
** release 0.8 [61%]
|
||||||
** release 0.8 [63%]
|
|
||||||
- [X] remove gio dependency
|
- [X] remove gio dependency
|
||||||
- [X] fix macos/wordexp bug(?)
|
- [X] fix macos/wordexp bug(?)
|
||||||
- [X] fix rhel5 installation issue
|
- [X] fix rhel5 installation issue
|
||||||
|
@ -26,11 +25,12 @@
|
||||||
- [X] summary
|
- [X] summary
|
||||||
- [X] attachment handling
|
- [X] attachment handling
|
||||||
- [ ] review docs
|
- [ ] review docs
|
||||||
- [ ] completion for zsh
|
|
||||||
- [ ] don't make test mail files executable
|
- [ ] don't make test mail files executable
|
||||||
- [X] add summary unit test(s)
|
- [X] add summary unit test(s)
|
||||||
- [ ] add attachment unit test(s)
|
- [ ] add attachment unit test(s)
|
||||||
- [ ] fix e-mail address searches (issue #21)
|
- [ ] fix e-mail address searches (issue #21)
|
||||||
|
- [ ] mu-easy.1, man page with simple examples
|
||||||
|
- [X] fix progress info
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,6 @@
|
||||||
|
|
||||||
static gboolean MU_CAUGHT_SIGNAL;
|
static gboolean MU_CAUGHT_SIGNAL;
|
||||||
|
|
||||||
static void
|
|
||||||
maybe_newline (gboolean quiet)
|
|
||||||
{
|
|
||||||
if (!quiet)
|
|
||||||
g_print ("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_warning (void)
|
update_warning (void)
|
||||||
{
|
{
|
||||||
|
@ -113,14 +106,18 @@ index_msg_silent_cb (MuIndexStats* stats, void *user_data)
|
||||||
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned
|
static void
|
||||||
print_stats (MuIndexStats* stats)
|
print_stats (MuIndexStats* stats, gboolean clear)
|
||||||
{
|
{
|
||||||
char *kars="-\\|/";
|
char *kars="-\\|/";
|
||||||
char output[120];
|
char output[120];
|
||||||
|
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
unsigned len = 0;
|
static unsigned len = 0;
|
||||||
|
|
||||||
|
if (clear)
|
||||||
|
while (len --> 0) /* note the --> operator :-) */
|
||||||
|
g_print ("\b");
|
||||||
|
|
||||||
len = (unsigned) snprintf (output, sizeof(output),
|
len = (unsigned) snprintf (output, sizeof(output),
|
||||||
"%c processing mail; processed: %u; "
|
"%c processing mail; processed: %u; "
|
||||||
|
@ -131,25 +128,16 @@ print_stats (MuIndexStats* stats)
|
||||||
(unsigned)stats->_cleaned_up);
|
(unsigned)stats->_cleaned_up);
|
||||||
|
|
||||||
g_print ("%s", output);
|
g_print ("%s", output);
|
||||||
return len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static MuResult
|
static MuResult
|
||||||
index_msg_cb (MuIndexStats* stats, void *user_data)
|
index_msg_cb (MuIndexStats* stats, void *user_data)
|
||||||
{
|
{
|
||||||
static unsigned len = 0;
|
|
||||||
|
|
||||||
if (MU_CAUGHT_SIGNAL)
|
|
||||||
return MU_STOP;
|
|
||||||
|
|
||||||
if (stats->_processed % 25)
|
if (stats->_processed % 25)
|
||||||
return MU_OK;
|
return MU_OK;
|
||||||
|
|
||||||
while (len --> 0) /* note the --> operator :-) */
|
print_stats (stats, TRUE);
|
||||||
g_print ("\b");
|
|
||||||
|
|
||||||
len = print_stats (stats);
|
|
||||||
|
|
||||||
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
return MU_CAUGHT_SIGNAL ? MU_STOP: MU_OK;
|
||||||
}
|
}
|
||||||
|
@ -228,8 +216,11 @@ mu_cmd_cleanup (MuConfigOptions *opts)
|
||||||
rv = mu_index_cleanup (midx, &stats,
|
rv = mu_index_cleanup (midx, &stats,
|
||||||
quiet ? index_msg_silent_cb : index_msg_cb,
|
quiet ? index_msg_silent_cb : index_msg_cb,
|
||||||
NULL);
|
NULL);
|
||||||
maybe_newline (opts->quiet);
|
if (!quiet) {
|
||||||
|
print_stats (&stats, TRUE);
|
||||||
|
g_print ("\n");
|
||||||
show_time ((unsigned)(time(NULL)-t),stats._processed);
|
show_time ((unsigned)(time(NULL)-t),stats._processed);
|
||||||
|
}
|
||||||
|
|
||||||
mu_index_destroy (midx);
|
mu_index_destroy (midx);
|
||||||
|
|
||||||
|
@ -265,8 +256,12 @@ mu_cmd_index (MuConfigOptions *opts)
|
||||||
install_sig_handler ();
|
install_sig_handler ();
|
||||||
rv = mu_index_run (midx, opts->maildir, opts->reindex, &stats,
|
rv = mu_index_run (midx, opts->maildir, opts->reindex, &stats,
|
||||||
quiet ? index_msg_silent_cb :index_msg_cb, NULL, NULL);
|
quiet ? index_msg_silent_cb :index_msg_cb, NULL, NULL);
|
||||||
maybe_newline (opts->quiet);
|
if (!quiet) {
|
||||||
show_time ((unsigned)(time(NULL)-t), stats._processed);
|
print_stats (&stats, TRUE);
|
||||||
|
g_print ("\n");
|
||||||
|
show_time ((unsigned)(time(NULL)-t),stats._processed);
|
||||||
|
}
|
||||||
|
|
||||||
mu_index_destroy (midx);
|
mu_index_destroy (midx);
|
||||||
|
|
||||||
if (rv == MU_OK && !opts->nocleanup)
|
if (rv == MU_OK && !opts->nocleanup)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user