From: Federico Kircheis Date: Sat, 29 Jun 2019 13:06:28 +0000 (+0200) Subject: Replace `new` variable with `has_new_mail` X-Git-Tag: 2019-10-25~149^2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43e24d051d4f8afcc254733bf148e3d3374d3dac;p=neomutt Replace `new` variable with `has_new_mail` `new` is a reserved keyword in c++ --- diff --git a/browser.c b/browser.c index a3a803c3f..2b51fa34e 100644 --- a/browser.c +++ b/browser.c @@ -539,7 +539,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c case 'N': snprintf(fmt, sizeof(fmt), "%%%sc", prec); - snprintf(buf, buflen, fmt, folder->ff->new ? 'N' : ' '); + snprintf(buf, buflen, fmt, folder->ff->has_new_mail ? 'N' : ' '); break; case 'n': @@ -645,7 +645,7 @@ static void add_folder(struct Menu *menu, struct BrowserState *state, if (m) { (state->entry)[state->entrylen].has_mailbox = true; - (state->entry)[state->entrylen].new = m->has_new; + (state->entry)[state->entrylen].has_new_mail = m->has_new; (state->entry)[state->entrylen].msg_count = m->msg_count; (state->entry)[state->entrylen].msg_unread = m->msg_unread; } @@ -829,7 +829,8 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state) for (unsigned int i = 0; i < adata->groups_num; i++) { struct NntpMboxData *mdata = adata->groups_list[i]; - if (mdata && (mdata->new || (mdata->subscribed && (mdata->unread || !C_ShowOnlyUnread)))) + if (mdata && (mdata->has_new_mail || + (mdata->subscribed && (mdata->unread || !C_ShowOnlyUnread)))) { add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata); } diff --git a/browser.h b/browser.h index 9bdef94bc..318f5864e 100644 --- a/browser.h +++ b/browser.h @@ -67,9 +67,9 @@ struct FolderFile char *name; char *desc; - bool new; /**< true if mailbox has "new mail" */ - int msg_count; /**< total number of messages */ - int msg_unread; /**< number of unread messages */ + bool has_new_mail; /**< true if mailbox has "new mail" */ + int msg_count; /**< total number of messages */ + int msg_unread; /**< number of unread messages */ #ifdef USE_IMAP char delim; diff --git a/imap/browse.c b/imap/browse.c index ec402623d..203494208 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -125,7 +125,7 @@ static void add_folder(char delim, char *folder, bool noselect, bool noinferiors if (np) { (state->entry)[state->entrylen].has_mailbox = true; - (state->entry)[state->entrylen].new = np->mailbox->has_new; + (state->entry)[state->entrylen].has_new_mail = np->mailbox->has_new; (state->entry)[state->entrylen].msg_count = np->mailbox->msg_count; (state->entry)[state->entrylen].msg_unread = np->mailbox->msg_unread; } diff --git a/nntp/browse.c b/nntp/browse.c index 65ef7c6b9..d75c44413 100644 --- a/nntp/browse.c +++ b/nntp/browse.c @@ -104,7 +104,7 @@ const char *group_index_format_str(char *buf, size_t buflen, size_t col, int col if (folder->ff->nd->subscribed) snprintf(buf, buflen, fmt, ' '); else - snprintf(buf, buflen, fmt, folder->ff->new ? 'N' : 'u'); + snprintf(buf, buflen, fmt, folder->ff->has_new_mail ? 'N' : 'u'); break; case 'n': diff --git a/nntp/nntp.c b/nntp/nntp.c index 6c76dbc11..495a1faae 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -2077,7 +2077,7 @@ int nntp_active_fetch(struct NntpAccountData *adata, bool new) for (; i < adata->groups_num; i++) { struct NntpMboxData *mdata = adata->groups_list[i]; - mdata->new = true; + mdata->has_new_mail = true; } } @@ -2184,7 +2184,7 @@ int nntp_check_new_groups(struct Mailbox *m, struct NntpAccountData *adata) for (; i < adata->groups_num; i++) { struct NntpMboxData *mdata = adata->groups_list[i]; - mdata->new = true; + mdata->has_new_mail = true; } /* loading descriptions */ diff --git a/nntp/nntp.h b/nntp/nntp.h index b81eb94c8..51537865b 100644 --- a/nntp/nntp.h +++ b/nntp/nntp.h @@ -145,10 +145,10 @@ struct NntpMboxData anum_t last_loaded; anum_t last_cached; anum_t unread; - bool subscribed : 1; - bool new : 1; - bool allowed : 1; - bool deleted : 1; + bool subscribed : 1; + bool has_new_mail : 1; + bool allowed : 1; + bool deleted : 1; unsigned int newsrc_len; struct NewsrcEntry *newsrc_ent; struct NntpAccountData *adata;