{
case MUTT_IMAP:
case MUTT_POP:
- add_folder(menu, state, mutt_b2s(mailbox), np->mailbox->desc, NULL,
+ add_folder(menu, state, mutt_b2s(mailbox), np->mailbox->name, NULL,
np->mailbox, NULL);
continue;
case MUTT_NOTMUCH:
case MUTT_NNTP:
add_folder(menu, state, mutt_b2s(np->mailbox->pathbuf),
- np->mailbox->desc, NULL, np->mailbox, NULL);
+ np->mailbox->name, NULL, np->mailbox, NULL);
continue;
default: /* Continue */
break;
s.st_mtime = st2.st_mtime;
}
- add_folder(menu, state, mutt_b2s(mailbox), np->mailbox->desc, &s, np->mailbox, NULL);
+ add_folder(menu, state, mutt_b2s(mailbox), np->mailbox->name, &s, np->mailbox, NULL);
}
neomutt_mailboxlist_clear(&ml);
}
<entry>%D</entry>
<entry></entry>
<entry>
- Description of the mailbox
+ Descriptive name of the mailbox
</entry>
</row>
<row>
{
// Try to see if the buffer matches a description before we bail.
// We'll receive a non-null pointer if there is a corresponding mailbox.
- m = mutt_mailbox_find_desc(buf);
+ m = mutt_mailbox_find_name(buf);
if (m)
{
mutt_str_strfcpy(buf, mutt_b2s(m->pathbuf), buflen);
* mutt_push/pop_current_menu() functions. If that changes, the menu
* would need to be reset here, and the pager cleanup code after the
* switch statement would need to be run. */
- mutt_folder_hook(buf, m ? m->desc : NULL);
+ mutt_folder_hook(buf, m ? m->name : NULL);
const int flags = (C_ReadOnly || (op == OP_MAIN_CHANGE_FOLDER_READONLY)
#ifdef USE_NOTMUCH
mutt_extract_token(buf, s, MUTT_TOKEN_NO_FLAGS);
if (buf->data && (*buf->data != '\0'))
{
- m->desc = mutt_str_strdup(buf->data);
+ m->name = mutt_str_strdup(buf->data);
}
else
{
{
clear_this =
(mutt_str_strcasecmp(mutt_b2s(buf), mutt_b2s(np->mailbox->pathbuf)) == 0) ||
- (mutt_str_strcasecmp(mutt_b2s(buf), np->mailbox->desc) == 0);
+ (mutt_str_strcasecmp(mutt_b2s(buf), np->mailbox->name) == 0);
}
if (clear_this)
notify_free(&m->notify);
mutt_buffer_free(&m->pathbuf);
- FREE(&m->desc);
+ FREE(&m->name);
if (m->mdata && m->free_mdata)
m->free_mdata(&m->mdata);
FREE(&m->realpath);
}
/**
- * mutt_mailbox_find_desc - Find the mailbox with a given description
- * @param desc Description to match
+ * mutt_mailbox_find_name - Find the mailbox with a given name
+ * @param name Name to match
* @retval ptr Matching Mailbox
* @retval NULL No matching mailbox found
+ *
+ * @note This searches across all Accounts
*/
-struct Mailbox *mutt_mailbox_find_desc(const char *desc)
+struct Mailbox *mutt_mailbox_find_name(const char *name)
{
- if (!desc)
+ if (!name)
return NULL;
struct MailboxList ml = neomutt_mailboxlist_get_all(NeoMutt, MUTT_MAILBOX_ANY);
struct Mailbox *m = NULL;
STAILQ_FOREACH(np, &ml, entries)
{
- if (np->mailbox->desc && (mutt_str_strcmp(np->mailbox->desc, desc) == 0))
+ if (mutt_str_strcmp(np->mailbox->name, name) == 0)
{
m = np->mailbox;
break;
{
struct Buffer *pathbuf;
char *realpath; ///< used for duplicate detection, context comparison, and the sidebar
- char *desc;
+ char *name;
struct ConfigSubset *sub; ///< Inherited config items
off_t size;
bool has_new; /**< mailbox has new mail */
void mutt_mailbox_changed (struct Mailbox *m, enum MailboxNotification action);
void mutt_mailbox_cleanup (const char *path, struct stat *st);
struct Mailbox *mutt_mailbox_find (const char *path);
-struct Mailbox *mutt_mailbox_find_desc (const char *desc);
+struct Mailbox *mutt_mailbox_find_name (const char *name);
void mutt_mailbox_size_add (struct Mailbox *m, const struct Email *e);
void mutt_mailbox_size_sub (struct Mailbox *m, const struct Email *e);
void mutt_mailbox_update (struct Mailbox *m);
if (C_Spoolfile)
{
// Check if C_Spoolfile corresponds a mailboxes' description.
- struct Mailbox *m_desc = mutt_mailbox_find_desc(C_Spoolfile);
+ struct Mailbox *m_desc = mutt_mailbox_find_name(C_Spoolfile);
if (m_desc)
mutt_buffer_strcpy(folder, m_desc->realpath);
else
break;
case 'D':
- if (sbe->mailbox->desc)
- mutt_format_s(buf, buflen, prec, sbe->mailbox->desc);
+ if (sbe->mailbox->name)
+ mutt_format_s(buf, buflen, prec, sbe->mailbox->name);
else
mutt_format_s(buf, buflen, prec, sbe->box);
break;
rc = (m2->msg_unread - m1->msg_unread);
break;
case SORT_DESC:
- rc = mutt_str_strcmp(m1->desc, m2->desc);
+ rc = mutt_str_strcmp(m1->name, m2->name);
break;
case SORT_FLAGGED:
if (m2->msg_flagged == m1->msg_flagged)
}
if (mutt_list_find(&SidebarWhitelist, mutt_b2s(sbe->mailbox->pathbuf)) ||
- mutt_list_find(&SidebarWhitelist, sbe->mailbox->desc))
+ mutt_list_find(&SidebarWhitelist, sbe->mailbox->name))
{
/* Explicitly asked to be visible */
continue;
else
sidebar_folder_name = mutt_b2s(m->pathbuf) + maildir_is_prefix * (maildirlen + 1);
- if (m->desc)
+ if (m->name)
{
- sidebar_folder_name = m->desc;
+ sidebar_folder_name = m->name;
}
else if (maildir_is_prefix && C_SidebarFolderIndent)
{
case 'D':
{
struct Mailbox *m = Context ? Context->mailbox : NULL;
- // If there's a description, use it. Otherwise, fall-through
- if (m && m->desc)
+ // If there's a descriptive name, use it. Otherwise, fall-through
+ if (m && m->name)
{
- mutt_str_strfcpy(tmp, m->desc, sizeof(tmp));
+ mutt_str_strfcpy(tmp, m->name, sizeof(tmp));
snprintf(fmt, sizeof(fmt), "%%%ss", prec);
snprintf(buf, buflen, fmt, tmp);
break;
}
else
#endif
- if (m && (m->magic == MUTT_NOTMUCH) && m->desc)
+ if (m && (m->magic == MUTT_NOTMUCH) && m->name)
{
- mutt_str_strfcpy(tmp, m->desc, sizeof(tmp));
+ mutt_str_strfcpy(tmp, m->name, sizeof(tmp));
}
else if (m && !mutt_buffer_is_empty(m->pathbuf))
{