X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fstatus.c;h=ffbdaeeaa53fbdc85aa849ab9dc617444d2c5c39;hp=2dbf7e7c850f9ae6debefca74f84b6f1b04ddb6e;hb=38dacbf03fe1a0daa9ce426caaef5582b90006b2;hpb=1ee89902de184a640c171ae3285bff6882a791bd diff --git a/lib-ui/status.c b/lib-ui/status.c index 2dbf7e7..ffbdaee 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -11,10 +11,10 @@ #include #include +#include #include "mutt.h" #include "sort.h" -#include "mx.h" #include "buffy.h" #define SW (option(OPTMBOXPANE)?SidebarWidth:0) @@ -48,14 +48,14 @@ static char *get_sort_str (char *buf, ssize_t buflen, int method) * %V = currently active limit pattern [option] */ static const char *status_format_str (char *buf, ssize_t buflen, char op, const char *src, const char *prefix, - const char *ifstring, - const char *elsestring, - unsigned long data, format_flag flags) + const char *ifstr, + const char *elstr, + anytype data, format_flag flags) { - char fmt[SHORT_STRING], tmp[SHORT_STRING]; + char fmt[STRING], tmp[STRING]; const char *cp, *p; int count, optional = (flags & M_FORMAT_OPTIONAL); - MUTTMENU *menu = (MUTTMENU *) data; + MUTTMENU *menu = data.ptr; *buf = 0; switch (op) { @@ -70,7 +70,7 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, case 'B': snprintf (fmt, sizeof (fmt), "%%%ss", prefix); - if (Context && Context->compressinfo && Context->realpath) { + if (Context && Context->cinfo && Context->realpath) { if ((p = strrchr (Context->realpath, '/'))) m_strcpy(tmp, sizeof(tmp), p + 1); else @@ -104,17 +104,16 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, case 'f': snprintf (fmt, sizeof (fmt), "%%%ss", prefix); - if (Context && Context->compressinfo && Context->realpath) { + if (Context && Context->cinfo && Context->realpath) { m_strcpy(tmp, sizeof(tmp), Context->realpath); mutt_pretty_mailbox (tmp); - } - else + } else if (Context && Context->path) { m_strcpy(tmp, sizeof(tmp), Context->path); mutt_pretty_mailbox (tmp); - } - else + } else { m_strcpy(tmp, sizeof(tmp), _("(no mailbox)")); + } snprintf (buf, buflen, fmt, tmp); break; @@ -281,9 +280,9 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, } if (optional) - menu_status_line (buf, buflen, menu, ifstring); + menu_status_line (buf, buflen, menu, ifstr); else if (flags & M_FORMAT_OPTIONAL) - menu_status_line (buf, buflen, menu, elsestring); + menu_status_line (buf, buflen, menu, elstr); return (src); } @@ -294,7 +293,6 @@ void menu_status_line (char* buf, ssize_t len, MUTTMENU* menu, const char* p) { * only to not wrap past end of screen */ int width = COLS - SW; - mutt_FormatString (buf, (width >= len ? len : (width + 1)), - p, status_format_str, - (unsigned long) menu, 0); + m_strformat(buf, (width >= len ? len : (width + 1)), p, status_format_str, + menu, 0); }