X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/6bc7a34bda51d2a9a8d8406a249a2f8a51c321ec..cc4009f0f3bc5567eb5c7e03782518b607dcf16a:/debian/patches/mutt-patched/sidebar diff --git a/debian/patches/mutt-patched/sidebar b/debian/patches/mutt-patched/sidebar index e04d3db..94de9cf 100644 --- a/debian/patches/mutt-patched/sidebar +++ b/debian/patches/mutt-patched/sidebar @@ -23,10 +23,12 @@ in the "mutt-patched" package. The width of the sidebar. * Patch source: - - http://lunar-linux.org/~tchan/mutt/patch-1.5.18.sidebar.20080517.txt + - http://www.lunar-linux.org/index.php?page=mutt-sidebar + - http://lunar-linux.org/~tchan/mutt/patch-1.5.18.sidebar.20080611.txt * Changes made: - - Fixed conflict with maildir-mtime patch [myon] + - 2008-08-02 myon: Refreshed patch using quilt push -f to remove hunks we do + not need (Makefile.in). == END PATCH --- a/buffy.c @@ -49,7 +51,7 @@ in the "mutt-patched" package. #ifdef USE_IMAP if (tmp->magic != M_IMAP) #endif -@@ -353,30 +355,51 @@ int mutt_buffy_check (int force) +@@ -353,48 +355,112 @@ int mutt_buffy_check (int force) case M_MBOX: case M_MMDF: @@ -109,16 +111,13 @@ in the "mutt-patched" package. while ((de = readdir (dirp)) != NULL) { char *p; -@@ -385,12 +408,36 @@ int mutt_buffy_check (int force) + if (*de->d_name != '.' && + (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T'))) { - if (!tmp->new) - { -- /* one new and undeleted message is enough */ -- BuffyCount++; -- tmp->new = 1; -- -- if (! option (OPTMAILDIRMTIME)) /* prevent stat calls */ -- break; +- /* one new and undeleted message is enough */ +- BuffyCount++; +- tmp->new = 1; +- break; + tmp->has_new = tmp->new = 1; + tmp->msgcount++; + tmp->msg_unread++; @@ -149,10 +148,9 @@ in the "mutt-patched" package. + if (p && strchr(p + 3, 'F')) { + tmp->msg_flagged++; + } - } - snprintf (path, sizeof (path), "%s/new/%s", tmp->path, de->d_name); - if (!stat (path, &smd) && smd.st_mtime > tmp->mtime) -@@ -403,8 +450,25 @@ int mutt_buffy_check (int force) + } + } + closedir (dirp); break; case M_MH: @@ -182,12 +180,11 @@ in the "mutt-patched" package. } --- a/buffy.h +++ b/buffy.h -@@ -25,8 +25,13 @@ typedef struct buffy_t +@@ -25,7 +25,12 @@ typedef struct buffy_t char *path; long size; struct buffy_t *next; + struct buffy_t *prev; - time_t mtime; /* for maildirs...time of newest entry */ short new; /* mailbox has new mail */ + short has_new; /* set it new if new and not read */ + int msgcount; /* total number of messages */ @@ -837,10 +834,10 @@ in the "mutt-patched" package. #include "attach.h" #include "mbyte.h" +#include "sidebar.h" - void set_xterm_title_bar(char *title); - void set_xterm_icon_name(char *name); -@@ -1069,6 +1070,8 @@ static int format_line (struct line_t ** + #include "mx.h" + +@@ -1067,6 +1068,8 @@ static int format_line (struct line_t ** mbstate_t mbstate; int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap); @@ -849,7 +846,7 @@ in the "mutt-patched" package. /* FIXME: this should come from lineInfo */ memset(&mbstate, 0, sizeof(mbstate)); -@@ -1702,7 +1705,7 @@ mutt_pager (const char *banner, const ch +@@ -1700,7 +1703,7 @@ mutt_pager (const char *banner, const ch if ((redraw & REDRAW_BODY) || topline != oldtopline) { do { @@ -858,7 +855,7 @@ in the "mutt-patched" package. curline = oldtopline = topline; lines = 0; force_redraw = 0; -@@ -1715,6 +1718,7 @@ mutt_pager (const char *banner, const ch +@@ -1713,6 +1716,7 @@ mutt_pager (const char *banner, const ch &QuoteList, &q_level, &force_redraw, &SearchRE) > 0) lines++; curline++; @@ -866,7 +863,7 @@ in the "mutt-patched" package. } last_offset = lineInfo[curline].offset; } while (force_redraw); -@@ -1728,6 +1732,7 @@ mutt_pager (const char *banner, const ch +@@ -1726,6 +1730,7 @@ mutt_pager (const char *banner, const ch addch ('~'); addch ('\n'); lines++; @@ -874,7 +871,7 @@ in the "mutt-patched" package. } /* We are going to update the pager status bar, so it isn't * necessary to reset to normal color now. */ -@@ -1751,22 +1756,22 @@ mutt_pager (const char *banner, const ch +@@ -1749,22 +1754,22 @@ mutt_pager (const char *banner, const ch /* print out the pager status bar */ SETCOLOR (MT_COLOR_STATUS); BKGDSET (MT_COLOR_STATUS); @@ -901,7 +898,7 @@ in the "mutt-patched" package. BKGDSET (MT_COLOR_NORMAL); SETCOLOR (MT_COLOR_NORMAL); if (option(OPTXTERMSETTITLES)) -@@ -1783,18 +1788,23 @@ mutt_pager (const char *banner, const ch +@@ -1781,18 +1786,23 @@ mutt_pager (const char *banner, const ch /* redraw the pager_index indicator, because the * flags for this message might have changed. */ menu_redraw_current (index); @@ -927,7 +924,7 @@ in the "mutt-patched" package. redraw = 0; if (option(OPTBRAILLEFRIENDLY)) { -@@ -2673,6 +2683,13 @@ search_next: +@@ -2671,6 +2681,13 @@ search_next: redraw = REDRAW_FULL; break; @@ -943,7 +940,7 @@ in the "mutt-patched" package. break; --- /dev/null +++ b/sidebar.c -@@ -0,0 +1,328 @@ +@@ -0,0 +1,333 @@ +/* + * Copyright (C) ????-2004 Justin Hibbits + * Copyright (C) 2004 Thomer M. Gil @@ -1083,8 +1080,6 @@ in the "mutt-patched" package. +int draw_sidebar(int menu) { + + int lines = option(OPTHELP) ? 1 : 0; -+ int sidebar_folder_depth; -+ char *sidebar_folder_name; + BUFFY *tmp; +#ifndef USE_SLANG_CURSES + attr_t attrs; @@ -1189,28 +1184,35 @@ in the "mutt-patched" package. + tmp->msgcount = Context->msgcount; + tmp->msg_flagged = Context->flagged; + } -+ sidebar_folder_depth = 0; -+ sidebar_folder_name = ""; // ... just in case -+ if ( strlen(tmp->path) > strlen(Maildir) ) { -+ int i; -+ char *tmp_folder_name; -+ tmp_folder_name = tmp->path + strlen(Maildir); -+ for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) { -+ if (tmp_folder_name[i] == '/') sidebar_folder_depth++; -+ } -+ if (sidebar_folder_depth > 0) { -+ sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1); -+ for (i=0; i < sidebar_folder_depth; i++) -+ sidebar_folder_name[i]=' '; -+ sidebar_folder_name[i]=0; -+ strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth); ++ // check whether Maildir is a prefix of the current folder's path ++ short maildir_is_prefix = 0; ++ if ( (strlen(tmp->path) > strlen(Maildir)) && ++ (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) ) ++ maildir_is_prefix = 1; ++ // calculate depth of current folder and generate its display name with indented spaces ++ int sidebar_folder_depth = 0; ++ char *sidebar_folder_name; ++ sidebar_folder_name = basename(tmp->path); ++ if ( maildir_is_prefix ) { ++ char *tmp_folder_name; ++ int i; ++ tmp_folder_name = tmp->path + strlen(Maildir); ++ for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) { ++ if (tmp_folder_name[i] == '/') sidebar_folder_depth++; ++ } ++ if (sidebar_folder_depth > 0) { ++ sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1); ++ for (i=0; i < sidebar_folder_depth; i++) ++ sidebar_folder_name[i]=' '; ++ sidebar_folder_name[i]=0; ++ strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth); ++ } + } -+ } else sidebar_folder_name = "INBOX"; -+ printw( "%.*s", SidebarWidth - delim_len + 1, -+ make_sidebar_entry(sidebar_folder_name, tmp->msgcount, -+ tmp->msg_unread, tmp->msg_flagged)); -+ if (sidebar_folder_depth > 0) -+ free(sidebar_folder_name); ++ printw( "%.*s", SidebarWidth - delim_len + 1, ++ make_sidebar_entry(sidebar_folder_name, tmp->msgcount, ++ tmp->msg_unread, tmp->msg_flagged)); ++ if (sidebar_folder_depth > 0) ++ free(sidebar_folder_name); + lines++; + } + SETCOLOR(MT_COLOR_NORMAL); @@ -1313,7 +1315,7 @@ in the "mutt-patched" package. +#endif /* SIDEBAR_H */ --- a/doc/Muttrc +++ b/doc/Muttrc -@@ -2085,6 +2085,26 @@ attachments -I message/external-body +@@ -2090,6 +2090,26 @@ attachments -I message/external-body # function. # # @@ -1370,4 +1372,4 @@ in the "mutt-patched" package. --- a/PATCHES +++ b/PATCHES @@ -0,0 +1 @@ -+patch-1.5.18.sidebar.20080517.txt ++patch-1.5.18.sidebar.20080611.txt