From 598ddfd9e5e0ea3fd368878e4bf8227014e478d5 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 13 May 2007 14:06:00 +0200 Subject: [PATCH] code simplifications. Signed-off-by: Pierre Habouzit --- imap/imap_private.h | 2 +- imap/message.c | 4 ---- init.h | 10 ---------- lib-mx/mh.c | 18 +++++------------- mutt.h | 3 --- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/imap/imap_private.h b/imap/imap_private.h index 5486c21..be4ba69 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -150,7 +150,7 @@ typedef struct { unsigned int newMailCount; IMAP_CACHE cache[IMAP_CACHE_LEN]; #ifdef USE_HCACHE - unsigned long uid_validity; + long uid_validity; #endif /* all folder flags - system flags AND keywords */ diff --git a/imap/message.c b/imap/message.c index b8a3ca4..cc339b7 100644 --- a/imap/message.c +++ b/imap/message.c @@ -20,10 +20,6 @@ #include "imap_private.h" #include "message.h" -#ifdef HAVE_PGP -#include "pgp.h" -#endif - static void flush_buffer (char *buf, size_t * len, CONNECTION * conn); static int msg_fetch_header (CONTEXT * ctx, IMAP_HEADER * h, char *buf, FILE * fp); diff --git a/init.h b/init.h index 37a0b0e..6d22d36 100644 --- a/init.h +++ b/init.h @@ -1066,16 +1066,6 @@ struct option_t MuttVars[] = { ** be a single global header cache. By default it is \fIunset\fP so no ** header caching will be used. */ - {"maildir_header_cache_verify", DT_BOOL, R_NONE, OPTHCACHEVERIFY, "yes" }, - /* - ** .pp - ** Availability: Header Cache - ** - ** .pp - ** Check for Maildir unaware programs other than Madmutt having modified maildir - ** files when the header cache is in use. This incurs one \fTstat(2)\fP per - ** message every time the folder is opened. - */ #if defined(HAVE_GDBM) {"header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, "16384"}, /* diff --git a/lib-mx/mh.c b/lib-mx/mh.c index 30a987f..7c2f7e2 100644 --- a/lib-mx/mh.c +++ b/lib-mx/mh.c @@ -753,19 +753,11 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); #ifdef USE_HCACHE - if (option (OPTHCACHEVERIFY)) { - ret = stat (fn, &lastchanged); - } - else { - lastchanged.st_mtime = 0; - ret = 0; - } - - if (data != NULL && !ret && lastchanged.st_mtime <= when->tv_sec) { + ret = stat(fn, &lastchanged); + if (data && !ret && lastchanged.st_mtime <= when->tv_sec) { p->h = mutt_hcache_restore(data, &p->h); maildir_parse_flags (p->h, fn); - } - else + } else #endif if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) { p->header_parsed = 1; @@ -773,9 +765,9 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) #ifdef USE_HCACHE mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen); #endif - } - else + } else { header_delete(&p->h); + } #ifdef USE_HCACHE p_delete(&data); #endif diff --git a/mutt.h b/mutt.h index d4ec656..023e254 100644 --- a/mutt.h +++ b/mutt.h @@ -232,11 +232,8 @@ enum { OPTFORCENAME, OPTFORWDECODE, OPTFORWQUOTE, -#ifdef USE_HCACHE - OPTHCACHEVERIFY, #ifdef HAVE_QDBM OPTHCACHECOMPRESS, -#endif /* HAVE_QDBM */ #endif OPTHDRS, OPTHEADER, -- 2.20.1