View | Details | Raw Unified | Return to bug 195076
Collapse All | Expand All

(-)./Makefile (-3 / +5 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	mutt
4
PORTNAME=	mutt
5
PORTVERSION=	1.5.23
5
PORTVERSION=	1.5.23
6
PORTREVISION?=	5
6
PORTREVISION?=	6
7
CATEGORIES+=	mail ipv6
7
CATEGORIES+=	mail ipv6
8
MASTER_SITES=	ftp://ftp.mutt.org/mutt/ \
8
MASTER_SITES=	ftp://ftp.mutt.org/mutt/ \
9
		ftp://ftp.mutt.org/mutt/devel/ \
9
		ftp://ftp.mutt.org/mutt/devel/ \
Lines 110-117 Link Here
110
		IMAP_HEADER_CACHE LOCALES_FIX MAILBOX_MANPAGES \
110
		IMAP_HEADER_CACHE LOCALES_FIX MAILBOX_MANPAGES \
111
		MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH NLS \
111
		MAILDIR_HEADER_CACHE MAILDIR_MTIME_PATCH NLS \
112
		NCURSES PARENT_CHILD_MATCH_PATCH QUOTE_PATCH \
112
		NCURSES PARENT_CHILD_MATCH_PATCH QUOTE_PATCH \
113
		REVERSE_REPLY_PATCH SIDEBAR_PATCH SMART_DATE \
113
		REVERSE_REPLY_PATCH SMART_DATE SMIME_OUTLOOK_COMPAT \
114
		SMIME_OUTLOOK_COMPAT SASL SMTP TRASH_PATCH XML
114
		SASL SMTP TRASH_PATCH XML
115
.endif
115
.endif
116
116
117
.include <bsd.port.options.mk>
117
.include <bsd.port.options.mk>
Lines 345-353 Link Here
345
.if ${PORT_OPTIONS:MNNTP}
345
.if ${PORT_OPTIONS:MNNTP}
346
post-patch::
346
post-patch::
347
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-nntp
347
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-nntp
348
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-refresh
348
.else
349
.else
349
post-patch::
350
post-patch::
350
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar
351
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar
352
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-sidebar-refresh
351
.endif
353
.endif
352
.endif
354
.endif
353
355
(-)./files/extra-patch-sidebar-refresh (+113 lines)
Line 0 Link Here
1
--- mutt.orig/buffy.c	2012-11-02 13:16:39.000000000 +0100
2
+++ mutt/buffy.c	2012-11-02 13:20:52.000000000 +0100
3
@@ -26,6 +26,7 @@
4
 #include "mx.h"
5
 
6
 #include "mutt_curses.h"
7
+#include "sidebar.h"
8
 
9
 #ifdef USE_IMAP
10
 #include "imap.h"
11
@@ -564,19 +565,28 @@
12
       {
13
       case M_MBOX:
14
       case M_MMDF:
15
-	buffy_mbox_update (tmp);
16
+	if (sidebar_should_refresh()) {
17
+	  buffy_mbox_update (tmp);
18
+	  sidebar_updated();
19
+	}
20
 	if (buffy_mbox_hasnew (tmp, &sb) > 0)
21
 	  BuffyCount++;
22
 	break;
23
 
24
       case M_MAILDIR:
25
-	buffy_maildir_update (tmp);
26
+	if (sidebar_should_refresh()) {
27
+	  buffy_maildir_update (tmp);
28
+	  sidebar_updated();
29
+	}
30
 	if (buffy_maildir_hasnew (tmp) > 0)
31
 	  BuffyCount++;
32
 	break;
33
 
34
       case M_MH:
35
-	mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
36
+	if (sidebar_should_refresh()) {
37
+	  mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
38
+	  sidebar_updated();
39
+	}
40
 	mh_buffy(tmp);
41
 	if (tmp->new)
42
 	  BuffyCount++;
43
Index: mutt/globals.h
44
===================================================================
45
--- mutt.orig/globals.h	2012-11-02 13:16:39.000000000 +0100
46
+++ mutt/globals.h	2012-11-02 13:16:40.000000000 +0100
47
@@ -214,6 +214,8 @@
48
 WHERE struct buffy_t *CurBuffy INITVAL(0);
49
 WHERE short DrawFullLine INITVAL(0);
50
 WHERE short SidebarWidth;
51
+WHERE short SidebarRefresh;
52
+WHERE short SidebarLastRefresh;
53
 #ifdef USE_IMAP
54
 WHERE short ImapKeepalive;
55
 WHERE short ImapPipelineDepth;
56
Index: mutt/init.h
57
===================================================================
58
--- mutt.orig/init.h	2012-11-02 13:16:39.000000000 +0100
59
+++ mutt/init.h	2012-11-02 13:16:40.000000000 +0100
60
@@ -2009,6 +2009,12 @@
61
   { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
62
   /*
63
   ** .pp
64
+  ** Do not refresh sidebar in less than $sidebar_refresh seconds,
65
+  ** (0 disables refreshing).
66
+  */
67
+  { "sidebar_refresh", DT_NUM, R_BOTH, UL &SidebarRefresh, 60 },
68
+  /*
69
+  ** .pp
70
   ** The width of the sidebar.
71
   */
72
   { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 0 },
73
Index: mutt/sidebar.c
74
===================================================================
75
--- mutt.orig/sidebar.c	2012-11-02 13:16:39.000000000 +0100
76
+++ mutt/sidebar.c	2012-11-02 13:16:40.000000000 +0100
77
@@ -252,6 +252,7 @@
78
                 saveSidebarWidth = SidebarWidth;
79
                 if(!option(OPTSIDEBAR)) SidebarWidth = 0;
80
                 initialized = true;
81
+		SidebarLastRefresh = time(NULL);
82
         }
83
 
84
         /* save or restore the value SidebarWidth */
85
@@ -464,3 +465,16 @@
86
 	set_curbuffy("");	/* default is the first mailbox */
87
 	draw_sidebar(menu);
88
 }
89
+
90
+int sidebar_should_refresh()
91
+{
92
+	if (option(OPTSIDEBAR) && SidebarRefresh > 0) {
93
+		if (time(NULL) - SidebarLastRefresh >= SidebarRefresh)
94
+			return 1;
95
+	}
96
+	return 0;
97
+}
98
+void sidebar_updated()
99
+{
100
+	SidebarLastRefresh = time(NULL);
101
+}
102
Index: mutt/sidebar.h
103
===================================================================
104
--- mutt.orig/sidebar.h	2012-11-02 13:16:39.000000000 +0100
105
+++ mutt/sidebar.h	2012-11-02 13:16:40.000000000 +0100
106
@@ -32,5 +32,7 @@
107
 void scroll_sidebar(int, int);
108
 void set_curbuffy(char*);
109
 void set_buffystats(CONTEXT*);
110
+int sidebar_should_refresh();
111
+void sidebar_updated();
112
 
113
 #endif /* SIDEBAR_H */

Return to bug 195076