Skip to content

Commit

Permalink
rename buffy
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Aug 3, 2018
1 parent 7a4ba8c commit 1180acb
Show file tree
Hide file tree
Showing 31 changed files with 200 additions and 193 deletions.
14 changes: 7 additions & 7 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
- Updated French translation
- Fix imap sync segfault due to inactive headers during an expunge
- Close the imap socket for the selected mailbox on error
- Add missing IMAP_CMD_POLL flag in imap buffy check
- Add missing IMAP_CMD_POLL flag in imap mailbox check
- Change maildir and mh check_mailbox to use dynamic sized hash
- Fix uses of context->changed as a counter
- Make cmd_parse_fetch() more precise about setting reopen/check flags
Expand Down Expand Up @@ -485,7 +485,7 @@
* Tidy
- drop VirtIncoming
- split mutt_parse_mailboxes into mutt_parse_unmailboxes
- tidy some buffy code
- tidy some mailbox code
- tidy the version strings
* Upstream
- Add ~<() and ~>() immediate parent/children patterns
Expand Down Expand Up @@ -970,7 +970,7 @@
- Add option for missing subject replacement
- notmuch: Allow <modify-labels> to toggle labels
- Support for aborting mailbox loading
- Do a buffy check after shell escape
- Do a mailbox check after shell escape
- Support of relative paths sourcing and cyclic source detection
- Support of multiple config files as CLI arguments
- Extend the ~m pattern to allow relative ranges
Expand Down Expand Up @@ -1375,14 +1375,14 @@
- Add sidebar_format flag '%n' to display 'N' on new mail.
- fix index_format truncation problem
- Fix compiler warnings due to always true condition
- Change sidebar next/prev-new to look at buffy->new too.
- Change sidebar next/prev-new to look at mailbox->new too.
- Change the default for sidebar_format to use %n.
- sidebar "unsorted" order to match Buffy list order.
- sidebar "unsorted" order to match Mailbox list order.
- Include ncurses tinfo library if found.
- Sidebar width problem
- sidebar crash for non-existent mailbox
- Temporary compatibility workaround
- Reset buffy->new for the current mailbox in IMAP.
- Reset mailbox->new for the current mailbox in IMAP.
- version.sh regression
- crash when notmuch tries to read a message
- status line wrapping
Expand Down Expand Up @@ -1413,7 +1413,7 @@
- Single quote at line beginning misinterpreted by groff
- Setting $sidebar_width to more than 128 would cause bad things to happen.
- Fix alignment in the compose menu.
- Fix sidebar buffy stats updating on mailbox close.
- Fix sidebar mailbox stats updating on mailbox close.
* Build Changes
- Sync whitespace to mutt/default
- Alter ChangeLog date format to simplify Makefiles
Expand Down
32 changes: 16 additions & 16 deletions browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ static int browser_compare_count(const void *a, const void *b)
struct FolderFile *pb = (struct FolderFile *) b;

int r = 0;
if (pa->has_buffy && pb->has_buffy)
if (pa->has_mailbox && pb->has_mailbox)
r = pa->msg_count - pb->msg_count;
else if (pa->has_buffy)
else if (pa->has_mailbox)
r = -1;
else
r = 1;
Expand All @@ -241,9 +241,9 @@ static int browser_compare_count_new(const void *a, const void *b)
struct FolderFile *pb = (struct FolderFile *) b;

int r = 0;
if (pa->has_buffy && pb->has_buffy)
if (pa->has_mailbox && pb->has_mailbox)
r = pa->msg_unread - pb->msg_unread;
else if (pa->has_buffy)
else if (pa->has_mailbox)
r = -1;
else
r = 1;
Expand Down Expand Up @@ -516,7 +516,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c
case 'm':
if (!optional)
{
if (folder->ff->has_buffy)
if (folder->ff->has_mailbox)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, folder->ff->msg_count);
Expand All @@ -536,7 +536,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c
case 'n':
if (!optional)
{
if (folder->ff->has_buffy)
if (folder->ff->has_mailbox)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, folder->ff->msg_unread);
Expand Down Expand Up @@ -756,7 +756,7 @@ static void add_folder(struct Menu *m, struct BrowserState *state,

if (b)
{
(state->entry)[state->entrylen].has_buffy = true;
(state->entry)[state->entrylen].has_mailbox = true;
(state->entry)[state->entrylen].new = b->new;
(state->entry)[state->entrylen].msg_count = b->msg_count;
(state->entry)[state->entrylen].msg_unread = b->msg_unread;
Expand Down Expand Up @@ -856,7 +856,7 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state,
return -1;
}

mutt_buffy_check(0);
mutt_mailbox_check(0);

dp = opendir(d);
if (!dp)
Expand Down Expand Up @@ -926,7 +926,7 @@ static int examine_vfolders(struct Menu *menu, struct BrowserState *state)
if (STAILQ_EMPTY(&AllMailboxes))
return -1;

mutt_buffy_check(0);
mutt_mailbox_check(0);

init_state(state, menu);

Expand Down Expand Up @@ -981,7 +981,7 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)

if (STAILQ_EMPTY(&AllMailboxes))
return -1;
mutt_buffy_check(0);
mutt_mailbox_check(0);

struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
Expand Down Expand Up @@ -1161,10 +1161,10 @@ static void browser_highlight_default(struct BrowserState *state, struct Menu *m
* @param menu Current menu
* @param title Buffer for the title
* @param titlelen Length of buffer
* @param buffy If true, select mailboxes
* @param mailbox If true, select mailboxes
*/
static void init_menu(struct BrowserState *state, struct Menu *menu,
char *title, size_t titlelen, bool buffy)
char *title, size_t titlelen, bool mailbox)
{
menu->max = state->entrylen;

Expand All @@ -1180,7 +1180,7 @@ static void init_menu(struct BrowserState *state, struct Menu *menu,
#ifdef USE_NNTP
if (OptNews)
{
if (buffy)
if (mailbox)
snprintf(title, titlelen, _("Subscribed newsgroups"));
else
{
Expand All @@ -1191,10 +1191,10 @@ static void init_menu(struct BrowserState *state, struct Menu *menu,
else
#endif
{
if (buffy)
if (mailbox)
{
menu->is_mailbox_list = 1;
snprintf(title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check(0));
snprintf(title, titlelen, _("Mailboxes [%d]"), mutt_mailbox_check(0));
}
else
{
Expand Down Expand Up @@ -2107,7 +2107,7 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int
break;

case OP_MAILBOX_LIST:
mutt_buffy_list();
mutt_mailbox_list();
break;

case OP_BROWSER_NEW_FILE:
Expand Down
2 changes: 1 addition & 1 deletion browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct FolderFile
bool selectable : 1;
bool inferiors : 1;
#endif
bool has_buffy : 1;
bool has_mailbox : 1;
bool local : 1; /**< folder is on local filesystem */
bool tagged : 1;
#ifdef USE_NNTP
Expand Down
10 changes: 5 additions & 5 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ void mutt_shell_escape(void)

if ((rc != 0) || WaitKey)
mutt_any_key_to_continue(NULL);
mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE);
mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE);
}

/**
Expand Down Expand Up @@ -1056,12 +1056,12 @@ int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt)
}
}

const int need_buffy_cleanup = (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF);
const int need_mailbox_cleanup = (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF);

mx_mbox_close(&ctx, NULL);

if (need_buffy_cleanup)
mutt_buffy_cleanup(buf, &st);
if (need_mailbox_cleanup)
mutt_mailbox_cleanup(buf, &st);

mutt_clear_error();
return 0;
Expand Down Expand Up @@ -1235,5 +1235,5 @@ bool mutt_check_traditional_pgp(struct Header *h, int *redraw)
*/
void mutt_check_stats(void)
{
mutt_buffy_check(MUTT_MAILBOX_CHECK_FORCE | MUTT_MAILBOX_CHECK_FORCE_STATS);
mutt_mailbox_check(MUTT_MAILBOX_CHECK_FORCE | MUTT_MAILBOX_CHECK_FORCE_STATS);
}
2 changes: 1 addition & 1 deletion context.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ enum AclRights
struct Context
{
char *path;
char *realpath; /**< used for buffy comparison and the sidebar */
char *realpath; /**< used for mailbox comparison and the sidebar */
FILE *fp;
time_t atime;
time_t mtime;
Expand Down
8 changes: 4 additions & 4 deletions curs_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,15 @@ int mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct
* @param[in] prompt Prompt
* @param[in] buf Buffer for the result
* @param[in] buflen Length of the buffer
* @param[in] buffy If true, select mailboxes
* @param[in] mailbox If true, select mailboxes
* @param[in] multiple Allow multiple selections
* @param[out] files List of files selected
* @param[out] numfiles Number of files selected
* @param[in] flags Flags, e.g. #MUTT_SEL_FOLDER
* @retval 0 Success
* @retval -1 Error
*/
int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool buffy,
int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool mailbox,
bool multiple, char ***files, int *numfiles, int flags)
{
struct Event ch;
Expand Down Expand Up @@ -584,7 +584,7 @@ int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool buf
flags = MUTT_SEL_FOLDER;
if (multiple)
flags |= MUTT_SEL_MULTI;
if (buffy)
if (mailbox)
flags |= MUTT_SEL_MAILBOX;
mutt_select_file(buf, buflen, flags, files, numfiles);
}
Expand All @@ -594,7 +594,7 @@ int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool buf

sprintf(pc, "%s: ", prompt);
mutt_unget_event(ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
if (mutt_get_field_full(pc, buf, buflen, (buffy ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR,
if (mutt_get_field_full(pc, buf, buflen, (mailbox ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR,
multiple, files, numfiles) != 0)
{
buf[0] = '\0';
Expand Down
2 changes: 1 addition & 1 deletion curs_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int mutt_any_key_to_continue(const char *s);
int mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct Pager *info);
void mutt_edit_file(const char *editor, const char *file);
void mutt_endwin(void);
int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, bool buffy, bool multiple, char ***files, int *numfiles, int flags);
int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, bool mailbox, bool multiple, char ***files, int *numfiles, int flags);
void mutt_flushinp(void);
void mutt_flush_macro_to_endcond(void);
void mutt_flush_unget_to_endcond(void);
Expand Down
Loading

0 comments on commit 1180acb

Please sign in to comment.