X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=mx.c;h=8b4272622a3f53b913f9a95cb07849cb2e51a369;hb=5ccacda9b868a0db6bb78ce6e3503861f6b93b67;hp=5764a51d1edfb8fe8a231b24eefaab3cd2ac764d;hpb=ce220f6dc8789ed75468c63adce953fbdfed11a8;p=apps%2Fmadmutt.git diff --git a/mx.c b/mx.c index 5764a51..8b42726 100644 --- a/mx.c +++ b/mx.c @@ -21,6 +21,7 @@ #include "copy.h" #include "keymap.h" #include "url.h" +#include "sidebar.h" #ifdef USE_COMPRESSED #include "compress.h" @@ -55,6 +56,7 @@ #include "lib/intl.h" #include "lib/str.h" #include "lib/list.h" +#include "lib/debug.h" #include #include @@ -200,7 +202,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int timeout) while (fcntl (fd, F_SETLK, &lck) == -1) { struct stat sb; - dprint (1, (debugfile, "mx_lock_file(): fcntl errno %d.\n", errno)); + debug_print (1, ("fcntl errno %d.\n", errno)); if (errno != EAGAIN && errno != EACCES) { mutt_perror ("fcntl"); return (-1); @@ -972,6 +974,9 @@ void mx_update_tables (CONTEXT * ctx, int committing) } #undef this_body ctx->msgcount = j; + + /* update sidebar count */ + sidebar_set_buffystats (ctx); } @@ -1072,6 +1077,9 @@ int mx_sync_mailbox (CONTEXT * ctx, int *index_hint) return 0; } + /* update sidebar counts */ + sidebar_set_buffystats (ctx); + /* if we haven't deleted any messages, we don't need to resort */ /* ... except for certain folder formats which need "unsorted" * sort order in order to synchronize folders. @@ -1105,8 +1113,7 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags) ADDRESS *p = NULL; if (!MX_IDX(dest->magic-1)) { - dprint (1, (debugfile, "mx_open_new_message(): function " - "unimplemented for mailbox type %d.\n", dest->magic)); + debug_print (1, ("function unimplemented for mailbox type %d.\n", dest->magic)); return (NULL); } @@ -1206,7 +1213,7 @@ int mx_check_mailbox (CONTEXT * ctx, int *index_hint, int lock) } } - dprint (1, (debugfile, "mx_check_mailbox: null or invalid context.\n")); + debug_print (1, ("null or invalid context.\n")); return (-1); } @@ -1236,8 +1243,7 @@ MESSAGE *mx_open_message (CONTEXT * ctx, int msgno) if (msg->fp == NULL) { mutt_perror (path); - dprint (1, (debugfile, "mx_open_message: fopen: %s: %s (errno %d).\n", - path, strerror (errno), errno)); + debug_print (1, ("fopen: %s: %s (errno %d).\n", path, strerror (errno), errno)); FREE (&msg); } } @@ -1271,10 +1277,7 @@ MESSAGE *mx_open_message (CONTEXT * ctx, int msgno) #endif /* USE_NNTP */ default: - dprint (1, - (debugfile, - "mx_open_message(): function not implemented for mailbox type %d.\n", - ctx->magic)); + debug_print (1, ("function not implemented for mailbox type %d.\n", ctx->magic)); FREE (&msg); break; } @@ -1288,10 +1291,7 @@ int mx_commit_message (MESSAGE * msg, CONTEXT * ctx) int r = 0; if (!(msg->write && ctx->append)) { - dprint (1, - (debugfile, - "mx_commit_message(): msg->write = %d, ctx->append = %d\n", - msg->write, ctx->append)); + debug_print (1, ("msg->write = %d, ctx->append = %d\n", msg->write, ctx->append)); return -1; } @@ -1364,8 +1364,7 @@ int mx_close_message (MESSAGE ** msg) (*msg)->fp = NULL; if ((*msg)->path) { - dprint (1, (debugfile, "mx_close_message (): unlinking %s\n", - (*msg)->path)); + debug_print (1, ("unlinking %s\n", (*msg)->path)); unlink ((*msg)->path); FREE (&(*msg)->path); } @@ -1463,6 +1462,8 @@ void mx_update_context (CONTEXT * ctx, int new_messages) ctx->new++; } } + /* update sidebar count */ + sidebar_set_buffystats (ctx); } /*