From: pdmef Date: Mon, 14 Mar 2005 11:37:59 +0000 (+0000) Subject: Rocco Rutte: X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=afc6ec8843e341b9661df5888050ec36536734d0 Rocco Rutte: sidebar update (indicator placement, correct use of ctx->new, ...) git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@177 e385b8ad-14ed-0310-8656-cc95a2468c6d --- diff --git a/buffy.c b/buffy.c index e486aba..c955ab9 100644 --- a/buffy.c +++ b/buffy.c @@ -274,9 +274,10 @@ int mutt_buffy_check (int force) DIR *dirp; char path[_POSIX_PATH_MAX]; struct stat contex_sb; - time_t now, last1, last2; + time_t now, last1; CONTEXT *ctx; #ifdef USE_IMAP + time_t last2; /* update postponed count as well, on force */ if (force != 0) mutt_update_num_postponed (); @@ -533,7 +534,7 @@ int mutt_buffy_check (int force) tmp->size = (long) sb.st_size; /* update the size */ #endif - if (!tmp->new) + if (tmp->new <= 0) tmp->notified = 0; else if (!tmp->notified) BuffyNotify++; @@ -563,7 +564,7 @@ int mutt_buffy_list (void) for (tmp = Incoming; tmp; tmp = tmp->next) { /* Is there new mail in this mailbox? */ - if (!tmp->new || (have_unnotified && tmp->notified)) + if (tmp->new <= 0 || (have_unnotified && tmp->notified)) continue; strfcpy (path, tmp->path, sizeof (path)); @@ -633,7 +634,7 @@ void mutt_buffy (char *s, size_t slen) case 1: - while (tmp && !tmp->new) + while (tmp && tmp->new <= 0) tmp = tmp->next; if (!tmp) { @@ -652,7 +653,7 @@ void mutt_buffy (char *s, size_t slen) { if (mutt_strcmp (s, tmp->path) == 0) count++; - else if (count && tmp->new) + else if (count && tmp->new > 0) break; tmp = tmp->next; if (!tmp) diff --git a/commands.c b/commands.c index d60bd52..86a83ba 100644 --- a/commands.c +++ b/commands.c @@ -832,7 +832,7 @@ int mutt_save_message (HEADER *h, int delete, { #ifdef BUFFY_SIZE tmp = mutt_find_mailbox (buf); - if (tmp && !tmp->new) + if (tmp && tmp->new <= 0) mutt_update_mailbox (tmp); #else /* fix up the times so buffy won't get confused */ diff --git a/curs_main.c b/curs_main.c index 8008f5f..1e50716 100644 --- a/curs_main.c +++ b/curs_main.c @@ -479,8 +479,12 @@ int mutt_index_menu (void) #endif IndexHelp); - if (!attach_msg) + if (!attach_msg) { mutt_buffy_check(1); /* force the buffy check after we enter the folder */ + /* record folder we open to place sidebar indicator properly */ + if (Context && Context->path) + set_curbuffy(Context->path); + } FOREVER { diff --git a/sidebar.c b/sidebar.c index cc7350e..001c720 100644 --- a/sidebar.c +++ b/sidebar.c @@ -212,6 +212,7 @@ void set_buffystats (CONTEXT* Context) { if (strcmp (tmp->path, Context->path) == 0) { + tmp->new = Context->new; tmp->msg_unread = Context->unread; tmp->msgcount = Context->msgcount; tmp->msg_flagged = Context->flagged; @@ -264,7 +265,9 @@ int draw_sidebar(int menu) { lines = option(OPTHELP) ? 1 : 0; /* go back to the top */ if ( CurBuffy == 0 ) CurBuffy = Incoming; +#if 0 if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) +#endif calc_boundaries(menu); tmp = TopBuffy; diff --git a/status.c b/status.c index 8f58fec..42d4fce 100644 --- a/status.c +++ b/status.c @@ -198,7 +198,7 @@ status_format_str (char *buf, size_t buflen, char op, const char *src, snprintf (fmt, sizeof (fmt), "%%%sd", prefix); snprintf (buf, buflen, fmt, Context ? Context->new : 0); } - else if (!Context || !Context->new) + else if (!Context || Context->new <= 0) optional = 0; break;