diff options
author | pi <pi@FreeBSD.org> | 2014-11-22 21:53:34 +0800 |
---|---|---|
committer | pi <pi@FreeBSD.org> | 2014-11-22 21:53:34 +0800 |
commit | 42a6b77678c8ddfa912d85aa6f76cf79764f7769 (patch) | |
tree | 86399c4c4c3d5835f1a1c66e128b1569cd37d769 | |
parent | b7c68812f046cd334d4877880ef3f4a0c6c60f9a (diff) | |
download | freebsd-ports-gnome-42a6b77678c8ddfa912d85aa6f76cf79764f7769.tar.gz freebsd-ports-gnome-42a6b77678c8ddfa912d85aa6f76cf79764f7769.tar.zst freebsd-ports-gnome-42a6b77678c8ddfa912d85aa6f76cf79764f7769.zip |
mail/mutt: improve sidebar function when handling many mail folders
- Add code to improve sidebar function when handling many mail folders
- Remove sidebar patch from default options to fix issues with packages
(may be reverted later if confidence in current sidebar patch has grown)
- Bump PORTREVISION due to default options changes
PR: 195076
Submitted by: Udo.Schweigert@siemens.com (maintainer)
-rw-r--r-- | mail/mutt/Makefile | 8 | ||||
-rw-r--r-- | mail/mutt/files/extra-patch-sidebar-refresh | 113 | ||||
-rw-r--r-- | mail/mutt/pkg-plist | 3 |
3 files changed, 118 insertions, 6 deletions
diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile index 3ece5fc3c8fb..b41625e2d530 100644 --- a/mail/mutt/Makefile +++ b/mail/mutt/Makefile @@ -3,7 +3,7 @@ PORTNAME= mutt PORTVERSION= 1.5.23 -PORTREVISION?= 5 +PORTREVISION?= 6 CATEGORIES+= mail ipv6 MASTER_SITES= ftp://ftp.mutt.org/mutt/ \ ftp://ftp.mutt.org/mutt/devel/ \ @@ -110,8 +110,8 @@ OPTIONS_DEFAULT= COMPRESSED_FOLDERS HTML ICONV IDN IFDEF_PATCH \ IMAP_HEADER_CACHE LOCALES_FIX MAILBOX_MANPAGES \ MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH NLS \ NCURSES PARENT_CHILD_MATCH_PATCH QUOTE_PATCH \ - REVERSE_REPLY_PATCH SIDEBAR_PATCH SMART_DATE \ - SMIME_OUTLOOK_COMPAT SASL SMTP TRASH_PATCH XML + REVERSE_REPLY_PATCH SMART_DATE SMIME_OUTLOOK_COMPAT \ + SASL SMTP TRASH_PATCH XML .endif .include <bsd.port.options.mk> @@ -345,9 +345,11 @@ XML_NEEDED= yes .if ${PORT_OPTIONS:MNNTP} post-patch:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-nntp + @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-refresh .else post-patch:: @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar + @${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-refresh .endif .endif diff --git a/mail/mutt/files/extra-patch-sidebar-refresh b/mail/mutt/files/extra-patch-sidebar-refresh new file mode 100644 index 000000000000..870212b628ec --- /dev/null +++ b/mail/mutt/files/extra-patch-sidebar-refresh @@ -0,0 +1,113 @@ +--- mutt.orig/buffy.c 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/buffy.c 2012-11-02 13:20:52.000000000 +0100 +@@ -26,6 +26,7 @@ + #include "mx.h" + + #include "mutt_curses.h" ++#include "sidebar.h" + + #ifdef USE_IMAP + #include "imap.h" +@@ -564,19 +565,28 @@ + { + case M_MBOX: + case M_MMDF: +- buffy_mbox_update (tmp); ++ if (sidebar_should_refresh()) { ++ buffy_mbox_update (tmp); ++ sidebar_updated(); ++ } + if (buffy_mbox_hasnew (tmp, &sb) > 0) + BuffyCount++; + break; + + case M_MAILDIR: +- buffy_maildir_update (tmp); ++ if (sidebar_should_refresh()) { ++ buffy_maildir_update (tmp); ++ sidebar_updated(); ++ } + if (buffy_maildir_hasnew (tmp) > 0) + BuffyCount++; + break; + + case M_MH: +- mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged); ++ if (sidebar_should_refresh()) { ++ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged); ++ sidebar_updated(); ++ } + mh_buffy(tmp); + if (tmp->new) + BuffyCount++; +Index: mutt/globals.h +=================================================================== +--- mutt.orig/globals.h 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/globals.h 2012-11-02 13:16:40.000000000 +0100 +@@ -214,6 +214,8 @@ + WHERE struct buffy_t *CurBuffy INITVAL(0); + WHERE short DrawFullLine INITVAL(0); + WHERE short SidebarWidth; ++WHERE short SidebarRefresh; ++WHERE short SidebarLastRefresh; + #ifdef USE_IMAP + WHERE short ImapKeepalive; + WHERE short ImapPipelineDepth; +Index: mutt/init.h +=================================================================== +--- mutt.orig/init.h 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/init.h 2012-11-02 13:16:40.000000000 +0100 +@@ -2009,6 +2009,12 @@ + { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 }, + /* + ** .pp ++ ** Do not refresh sidebar in less than $sidebar_refresh seconds, ++ ** (0 disables refreshing). ++ */ ++ { "sidebar_refresh", DT_NUM, R_BOTH, UL &SidebarRefresh, 60 }, ++ /* ++ ** .pp + ** The width of the sidebar. + */ + { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 0 }, +Index: mutt/sidebar.c +=================================================================== +--- mutt.orig/sidebar.c 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/sidebar.c 2012-11-02 13:16:40.000000000 +0100 +@@ -252,6 +252,7 @@ + saveSidebarWidth = SidebarWidth; + if(!option(OPTSIDEBAR)) SidebarWidth = 0; + initialized = true; ++ SidebarLastRefresh = time(NULL); + } + + /* save or restore the value SidebarWidth */ +@@ -464,3 +465,16 @@ + set_curbuffy(""); /* default is the first mailbox */ + draw_sidebar(menu); + } ++ ++int sidebar_should_refresh() ++{ ++ if (option(OPTSIDEBAR) && SidebarRefresh > 0) { ++ if (time(NULL) - SidebarLastRefresh >= SidebarRefresh) ++ return 1; ++ } ++ return 0; ++} ++void sidebar_updated() ++{ ++ SidebarLastRefresh = time(NULL); ++} +Index: mutt/sidebar.h +=================================================================== +--- mutt.orig/sidebar.h 2012-11-02 13:16:39.000000000 +0100 ++++ mutt/sidebar.h 2012-11-02 13:16:40.000000000 +0100 +@@ -32,5 +32,7 @@ + void scroll_sidebar(int, int); + void set_curbuffy(char*); + void set_buffystats(CONTEXT*); ++int sidebar_should_refresh(); ++void sidebar_updated(); + + #endif /* SIDEBAR_H */ diff --git a/mail/mutt/pkg-plist b/mail/mutt/pkg-plist index 82770262bce7..a35b370b0958 100644 --- a/mail/mutt/pkg-plist +++ b/mail/mutt/pkg-plist @@ -49,7 +49,6 @@ man/man5/muttrc.5.gz %%HTML%%%%PORTDOCS%%%%DOCSDIR%%/security.html %%HTML%%%%PORTDOCS%%%%DOCSDIR%%/tuning.html %%XML%%%%HTML%%%%COMPRESS%%%%PORTDOCS%%%%DOCSDIR%%/compressed-folders.html -%%PORTDOCS%%@dirrm %%DOCSDIR%% %%PORTEXAMPLES%%%%EXAMPLESDIR%%/Mush.rc %%PORTEXAMPLES%%%%EXAMPLESDIR%%/Pine.rc %%PORTEXAMPLES%%%%EXAMPLESDIR%%/Tin.rc @@ -83,8 +82,6 @@ man/man5/muttrc.5.gz %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sample.muttrc-tlr %%PORTEXAMPLES%%%%EXAMPLESDIR%%/smime.rc %%PORTEXAMPLES%%%%EXAMPLESDIR%%/smime_keys_test.pl -%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%/iconv -%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% %%NLS%%share/locale/bg/LC_MESSAGES/mutt.mo %%NLS%%share/locale/ca/LC_MESSAGES/mutt.mo %%NLS%%share/locale/cs/LC_MESSAGES/mutt.mo |