struct Header *last_tag; /**< last tagged msg. used to link threads */
struct MuttThread *tree; /**< top of thread tree */
struct Hash *thread_hash; /**< hash table for threading */
- int *v2r; /**< mapping from virtual to real msgno */
- int vcount; /**< the number of virtual messages */
int tagged; /**< how many messages are tagged? */
int new; /**< how many new messages? */
int deleted; /**< how many deleted messages */
/* update the total size of the mailbox to reflect this deletion */
Context->mailbox->size -= body->length - new_length;
/* if the message is visible, update the visible size of the mailbox as well. */
- if (Context->v2r[hdr->msgno] != -1)
+ if (Context->mailbox->v2r[hdr->msgno] != -1)
Context->vsize -= body->length - new_length;
body->length = new_length;
}
#define CHECK_VISIBLE \
- if (Context && menu->current >= Context->vcount) \
+ if (Context && menu->current >= Context->mailbox->vcount) \
{ \
mutt_flushinp(); \
mutt_error(_(NoVisible)); \
break; \
}
-#define CURHDR Context->mailbox->hdrs[Context->v2r[menu->current]]
+#define CURHDR Context->mailbox->hdrs[Context->mailbox->v2r[menu->current]]
#define UNREAD(h) mutt_thread_contains_unread(Context, h)
#define FLAGGED(h) mutt_thread_contains_flagged(Context, h)
else
final = CURHDR->virtual;
- base = Context->mailbox->hdrs[Context->v2r[final]];
+ base = Context->mailbox->hdrs[Context->mailbox->v2r[final]];
/* Iterate all threads, perform collapse/uncollapse as needed */
top = Context->tree;
/* Restore the cursor */
mutt_set_virtual(Context);
- for (int j = 0; j < Context->vcount; j++)
+ for (int j = 0; j < Context->mailbox->vcount; j++)
{
- if (Context->mailbox->hdrs[Context->v2r[j]]->index == base->index)
+ if (Context->mailbox->hdrs[Context->mailbox->v2r[j]]->index == base->index)
{
menu->current = j;
break;
*/
static int ci_next_undeleted(int msgno)
{
- for (int i = msgno + 1; i < Context->vcount; i++)
- if (!Context->mailbox->hdrs[Context->v2r[i]]->deleted)
+ for (int i = msgno + 1; i < Context->mailbox->vcount; i++)
+ if (!Context->mailbox->hdrs[Context->mailbox->v2r[i]]->deleted)
return i;
return -1;
}
static int ci_previous_undeleted(int msgno)
{
for (int i = msgno - 1; i >= 0; i--)
- if (!Context->mailbox->hdrs[Context->v2r[i]]->deleted)
+ if (!Context->mailbox->hdrs[Context->mailbox->v2r[i]]->deleted)
return i;
return -1;
}
return 0;
int old = -1;
- for (int i = 0; i < Context->vcount; i++)
+ for (int i = 0; i < Context->mailbox->vcount; i++)
{
- if (!Context->mailbox->hdrs[Context->v2r[i]]->read &&
- !Context->mailbox->hdrs[Context->v2r[i]]->deleted)
+ if (!Context->mailbox->hdrs[Context->mailbox->v2r[i]]->read &&
+ !Context->mailbox->hdrs[Context->mailbox->v2r[i]]->deleted)
{
- if (!Context->mailbox->hdrs[Context->v2r[i]]->old)
+ if (!Context->mailbox->hdrs[Context->mailbox->v2r[i]]->old)
return i;
else if (old == -1)
old = i;
}
else
{
- return Context->vcount ? Context->vcount - 1 : 0;
+ return Context->mailbox->vcount ? Context->mailbox->vcount - 1 : 0;
}
return 0;
mutt_sort_headers(Context, false);
/* Restore the current message */
- for (int i = 0; i < Context->vcount; i++)
+ for (int i = 0; i < Context->mailbox->vcount; i++)
{
- if (Context->mailbox->hdrs[Context->v2r[i]] == current)
+ if (Context->mailbox->hdrs[Context->mailbox->v2r[i]] == current)
{
menu->current = i;
break;
{
if (!i)
{
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
ctx->vsize = 0;
}
if (mutt_pattern_exec(ctx->limit_pattern, MUTT_MATCH_FULL_ADDRESS, ctx,
ctx->mailbox->hdrs[i], NULL))
{
- assert(ctx->vcount < ctx->mailbox->msg_count);
- ctx->mailbox->hdrs[i]->virtual = ctx->vcount;
- ctx->v2r[ctx->vcount] = i;
+ assert(ctx->mailbox->vcount < ctx->mailbox->msg_count);
+ ctx->mailbox->hdrs[i]->virtual = ctx->mailbox->vcount;
+ ctx->mailbox->v2r[ctx->mailbox->vcount] = i;
ctx->mailbox->hdrs[i]->limited = true;
- ctx->vcount++;
+ ctx->mailbox->vcount++;
struct Body *b = ctx->mailbox->hdrs[i]->content;
ctx->vsize += b->length + b->offset - b->hdr_offset + padding;
}
/* take note of the current message */
if (oldcount)
{
- if (menu->current < ctx->vcount)
+ if (menu->current < ctx->mailbox->vcount)
menu->oldcurrent = index_hint;
else
oldcount = 0; /* invalid message number! */
if (oldcount)
{
/* restore the current message to the message it was pointing to */
- for (int i = 0; i < ctx->vcount; i++)
+ for (int i = 0; i < ctx->mailbox->vcount; i++)
{
- if (ctx->mailbox->hdrs[ctx->v2r[i]]->index == menu->oldcurrent)
+ if (ctx->mailbox->hdrs[ctx->mailbox->v2r[i]]->index == menu->oldcurrent)
{
menu->current = i;
break;
if (!Context || !menu || (num < 0) || (num >= Context->mailbox->hdrmax))
return;
- struct Header *h = Context->mailbox->hdrs[Context->v2r[num]];
+ struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[num]];
if (!h)
return;
if (reverse)
{
if (menu->top + menu->pagelen > menu->max)
- edgemsgno = Context->v2r[menu->max - 1];
+ edgemsgno = Context->mailbox->v2r[menu->max - 1];
else
- edgemsgno = Context->v2r[menu->top + menu->pagelen - 1];
+ edgemsgno = Context->mailbox->v2r[menu->top + menu->pagelen - 1];
}
else
- edgemsgno = Context->v2r[menu->top];
+ edgemsgno = Context->mailbox->v2r[menu->top];
for (tmp = h->thread->parent; tmp; tmp = tmp->parent)
{
if (!Context || (index_no < 0))
return 0;
- struct Header *h = Context->mailbox->hdrs[Context->v2r[index_no]];
+ struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[index_no]];
if (h && h->pair)
return h->pair;
}
#endif
- if (Context && Context->mailbox->hdrs && !(menu->current >= Context->vcount))
+ if (Context && Context->mailbox->hdrs && !(menu->current >= Context->mailbox->vcount))
{
menu_check_recenter(menu);
if (OptNeedResort && Context && Context->mailbox->msg_count && menu->current >= 0)
resort_index(menu);
- menu->max = Context ? Context->vcount : 0;
+ menu->max = Context ? Context->mailbox->vcount : 0;
oldcount = Context ? Context->mailbox->msg_count : 0;
if (OptRedrawTree && Context && Context->mailbox->msg_count && (Sort & SORT_MASK) == SORT_THREADS)
* modified underneath us.)
*/
- index_hint =
- (Context->vcount && menu->current >= 0 && menu->current < Context->vcount) ?
- CURHDR->index :
- 0;
+ index_hint = (Context->mailbox->vcount && menu->current >= 0 &&
+ menu->current < Context->mailbox->vcount) ?
+ CURHDR->index :
+ 0;
check = mx_mbox_check(Context, &index_hint);
if (check < 0)
Context->mailbox->quiet = q;
menu->redraw = REDRAW_FULL;
- menu->max = Context->vcount;
+ menu->max = Context->mailbox->vcount;
OptSearchInvalid = true;
}
case OP_TOGGLE_READ:
CHECK_IN_MAILBOX;
- menu->oldcurrent =
- (Context->vcount && menu->current >= 0 && menu->current < Context->vcount) ?
- CURHDR->index :
- -1;
+ menu->oldcurrent = (Context->mailbox->vcount && menu->current >= 0 &&
+ menu->current < Context->mailbox->vcount) ?
+ CURHDR->index :
+ -1;
if (op == OP_TOGGLE_READ)
{
char buf2[LONG_STRING];
{
/* try to find what used to be the current message */
menu->current = -1;
- for (i = 0; i < Context->vcount; i++)
+ for (i = 0; i < Context->mailbox->vcount; i++)
{
- if (Context->mailbox->hdrs[Context->v2r[i]]->index == menu->oldcurrent)
+ if (Context->mailbox->hdrs[Context->mailbox->v2r[i]]->index == menu->oldcurrent)
{
menu->current = i;
break;
Context->last_tag);
menu->redraw |= REDRAW_STATUS;
- if (Resolve && menu->current < Context->vcount - 1)
+ if (Resolve && menu->current < Context->mailbox->vcount - 1)
{
menu->current++;
menu->redraw |= REDRAW_MOTION_RESYNCH;
CHECK_MSGCOUNT;
CHECK_READONLY;
{
- int ovc = Context->vcount;
+ int ovc = Context->mailbox->vcount;
int oc = Context->mailbox->msg_count;
int check;
struct Header *newhdr = NULL;
/* don't attempt to move the cursor if there are no visible messages in the current limit */
- if (menu->current < Context->vcount)
+ if (menu->current < Context->mailbox->vcount)
{
/* threads may be reordered, so figure out what header the cursor
* should be on. #3092 */
if (newidx < 0)
newidx = ci_previous_undeleted(menu->current);
if (newidx >= 0)
- newhdr = Context->mailbox->hdrs[Context->v2r[newidx]];
+ newhdr = Context->mailbox->hdrs[Context->mailbox->v2r[newidx]];
}
check = mx_mbox_sync(Context, &index_hint);
if (check == 0)
{
- if (newhdr && Context->vcount != ovc)
+ if (newhdr && Context->mailbox->vcount != ovc)
{
- for (j = 0; j < Context->vcount; j++)
+ for (j = 0; j < Context->mailbox->vcount; j++)
{
- if (Context->mailbox->hdrs[Context->v2r[j]] == newhdr)
+ if (Context->mailbox->hdrs[Context->mailbox->v2r[j]] == newhdr)
{
menu->current = j;
break;
/* do a sanity check even if mx_mbox_sync failed. */
- if (menu->current < 0 || menu->current >= Context->vcount)
+ if (menu->current < 0 || menu->current >= Context->mailbox->vcount)
menu->current = ci_first_message();
}
{
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
}
- int hint = Context->mailbox->hdrs[Context->v2r[menu->current]]->index;
+ int hint = Context->mailbox->hdrs[Context->mailbox->v2r[menu->current]]->index;
/* If we are returning to the pager via an index menu redirection, we
* need to reset the menu->menu. Otherwise mutt_menu_pop_current() will
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (menu->current >= Context->vcount - 1)
+ if (menu->current >= Context->mailbox->vcount - 1)
{
if (menu->menu == MENU_MAIN)
mutt_error(_("You are on the last message"));
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (menu->current >= Context->vcount - 1)
+ if (menu->current >= Context->mailbox->vcount - 1)
{
if (menu->menu == MENU_MAIN)
mutt_error(_("You are on the last message"));
const int saved_current = menu->current;
i = menu->current;
menu->current = -1;
- for (j = 0; j != Context->vcount; j++)
+ for (j = 0; j != Context->mailbox->vcount; j++)
{
if (op == OP_MAIN_NEXT_NEW || op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_NEXT_NEW_THEN_UNREAD)
{
i++;
- if (i > Context->vcount - 1)
+ if (i > Context->mailbox->vcount - 1)
{
i = 0;
}
i--;
if (i < 0)
{
- i = Context->vcount - 1;
+ i = Context->mailbox->vcount - 1;
}
}
- struct Header *h = Context->mailbox->hdrs[Context->v2r[i]];
+ struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[i]];
if (h->collapsed && (Sort & SORT_MASK) == SORT_THREADS)
{
if (UNREAD(h) && first_unread == -1)
case OP_CREATE_ALIAS:
- mutt_alias_create(Context && Context->vcount ? CURHDR->env : NULL, NULL);
+ mutt_alias_create(Context && Context->mailbox->vcount ? CURHDR->env : NULL, NULL);
menu->redraw |= REDRAW_CURRENT;
break;
{
mutt_set_flag(Context, CURHDR, MUTT_DELETE, 0);
mutt_set_flag(Context, CURHDR, MUTT_PURGE, 0);
- if (Resolve && menu->current < Context->vcount - 1)
+ if (Resolve && menu->current < Context->mailbox->vcount - 1)
{
menu->current++;
menu->redraw |= REDRAW_MOTION_RESYNCH;
ctx->mailbox->hdrmax = count;
ctx->mailbox->hdrs = mutt_mem_calloc(count, sizeof(struct Header *));
- ctx->v2r = mutt_mem_calloc(count, sizeof(int));
+ ctx->mailbox->v2r = mutt_mem_calloc(count, sizeof(int));
ctx->mailbox->msg_count = 0;
if (count && (imap_read_headers(idata, 1, count, true) < 0))
struct Header **hdrs;
int hdrmax; /**< number of pointers in hdrs */
+ int *v2r; /**< mapping from virtual to real msgno */
+ int vcount; /**< the number of virtual messages */
bool notified; /**< user has been notified */
enum MailboxType magic; /**< mailbox type */
mutt_hash_destroy(&ctx->mailbox->subj_hash);
mutt_hash_destroy(&ctx->mailbox->label_hash);
mutt_clear_threads(ctx);
- FREE(&ctx->v2r);
+ FREE(&ctx->mailbox->v2r);
if (ctx->mailbox->readonly)
{
for (i = 0; i < ctx->mailbox->msg_count; i++)
ctx->mailbox->hdrmax = 0; /* force allocation of new headers */
ctx->mailbox->msg_count = 0;
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
ctx->vsize = 0;
ctx->tagged = 0;
ctx->deleted = 0;
{
struct ColorLineHead *color = NULL;
struct ColorLine *np = NULL;
- struct Header *hdr = Context->mailbox->hdrs[Context->v2r[index]];
+ struct Header *hdr = Context->mailbox->hdrs[Context->mailbox->v2r[index]];
int type = *s;
switch (type)
{
struct Header *cur = NULL;
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
ctx->vsize = 0;
int padding = mx_msg_padding_size(ctx);
cur = ctx->mailbox->hdrs[i];
if (cur->virtual >= 0)
{
- cur->virtual = ctx->vcount;
- ctx->v2r[ctx->vcount] = i;
- ctx->vcount++;
+ cur->virtual = ctx->mailbox->vcount;
+ ctx->mailbox->v2r[ctx->mailbox->vcount] = i;
+ ctx->mailbox->vcount++;
ctx->vsize += cur->content->length + cur->content->offset -
cur->content->hdr_offset + padding;
cur->num_hidden = mutt_get_hidden(ctx, cur);
for (int i = 0; i < ctx->mailbox->msg_count; i++)
mutt_header_free(&ctx->mailbox->hdrs[i]);
FREE(&ctx->mailbox->hdrs);
- FREE(&ctx->v2r);
+ FREE(&ctx->mailbox->v2r);
FREE(&ctx->pattern);
if (ctx->limit_pattern)
mutt_pattern_free(&ctx->limit_pattern);
int i, j, padding;
/* update memory to reflect the new state of the mailbox */
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
ctx->vsize = 0;
ctx->tagged = 0;
ctx->deleted = 0;
ctx->mailbox->hdrs[j]->msgno = j;
if (ctx->mailbox->hdrs[j]->virtual != -1)
{
- ctx->v2r[ctx->vcount] = j;
- ctx->mailbox->hdrs[j]->virtual = ctx->vcount++;
+ ctx->mailbox->v2r[ctx->mailbox->vcount] = j;
+ ctx->mailbox->hdrs[j]->virtual = ctx->mailbox->vcount++;
struct Body *b = ctx->mailbox->hdrs[j]->content;
ctx->vsize += b->length + b->offset - b->hdr_offset + padding;
}
{
mutt_mem_realloc(&ctx->mailbox->hdrs,
sizeof(struct Header *) * (ctx->mailbox->hdrmax += 25));
- mutt_mem_realloc(&ctx->v2r, sizeof(int) * ctx->mailbox->hdrmax);
+ mutt_mem_realloc(&ctx->mailbox->v2r, sizeof(int) * ctx->mailbox->hdrmax);
}
else
{
ctx->mailbox->hdrs =
mutt_mem_calloc((ctx->mailbox->hdrmax += 25), sizeof(struct Header *));
- ctx->v2r = mutt_mem_calloc(ctx->mailbox->hdrmax, sizeof(int));
+ ctx->mailbox->v2r = mutt_mem_calloc(ctx->mailbox->hdrmax, sizeof(int));
}
for (int i = ctx->mailbox->msg_count; i < ctx->mailbox->hdrmax; i++)
{
ctx->mailbox->hdrs[i] = NULL;
- ctx->v2r[i] = -1;
+ ctx->mailbox->v2r[i] = -1;
}
}
if (!ctx->pattern)
{
- ctx->v2r[ctx->vcount] = msgno;
- h->virtual = ctx->vcount++;
+ ctx->mailbox->v2r[ctx->mailbox->vcount] = msgno;
+ h->virtual = ctx->mailbox->vcount++;
}
else
h->virtual = -1;
mutt_hash_destroy(&ctx->mailbox->id_hash);
mutt_clear_threads(ctx);
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
ctx->deleted = 0;
ctx->new = 0;
ctx->mailbox->msg_unread = 0;
move(0, 0);
clrtobot();
- if (IsHeader(rd->extra) && Context && ((Context->vcount + 1) < PagerIndexLines))
- rd->indexlen = Context->vcount + 1;
+ if (IsHeader(rd->extra) && Context && ((Context->mailbox->vcount + 1) < PagerIndexLines))
+ rd->indexlen = Context->mailbox->vcount + 1;
else
rd->indexlen = PagerIndexLines;
rd->index = mutt_menu_new(MENU_MAIN);
rd->index->make_entry = index_make_entry;
rd->index->color = index_color;
- rd->index->max = Context ? Context->vcount : 0;
+ rd->index->max = Context ? Context->mailbox->vcount : 0;
rd->index->current = rd->extra->hdr->virtual;
rd->index->indexwin = rd->index_window;
rd->index->statuswin = rd->index_status_window;
* rd.index->current might be invalid */
rd.index->current =
MIN(rd.index->current, (Context->mailbox->msg_count - 1));
- index_hint = Context->mailbox->hdrs[Context->v2r[rd.index->current]]->index;
+ index_hint =
+ Context->mailbox->hdrs[Context->mailbox->v2r[rd.index->current]]->index;
bool q = Context->mailbox->quiet;
Context->mailbox->quiet = true;
update_index(rd.index, Context, check, oldcount, index_hint);
Context->mailbox->quiet = q;
- rd.index->max = Context->vcount;
+ rd.index->max = Context->mailbox->vcount;
/* If these header pointers don't match, then our email may have
* been deleted. Make the pointer safe, then leave the pager.
* This have a unpleasant behaviour to close the pager even the
* deleted message is not the opened one, but at least it's safe. */
- if (extra->hdr != Context->mailbox->hdrs[Context->v2r[rd.index->current]])
+ if (extra->hdr !=
+ Context->mailbox->hdrs[Context->mailbox->v2r[rd.index->current]])
{
- extra->hdr = Context->mailbox->hdrs[Context->v2r[rd.index->current]];
+ extra->hdr =
+ Context->mailbox->hdrs[Context->mailbox->v2r[rd.index->current]];
break;
}
}
#define KILO 1024
#define MEGA 1048576
#define HMSG(h) (((h)->msgno) + 1)
-#define CTX_MSGNO(c) (HMSG((c)->mailbox->hdrs[(c)->v2r[(c)->menu->current]]))
+#define CTX_MSGNO(c) (HMSG((c)->mailbox->hdrs[(c)->mailbox->v2r[(c)->menu->current]]))
#define MUTT_MAXRANGE -1
if (!me)
return false;
- Context->vcount = 0;
+ Context->mailbox->vcount = 0;
Context->vsize = 0;
Context->collapsed = false;
{
struct Body *body = Context->mailbox->hdrs[i]->content;
- Context->mailbox->hdrs[i]->virtual = Context->vcount;
+ Context->mailbox->hdrs[i]->virtual = Context->mailbox->vcount;
Context->mailbox->hdrs[i]->limited = true;
- Context->v2r[Context->vcount] = i;
- Context->vcount++;
+ Context->mailbox->v2r[Context->mailbox->vcount] = i;
+ Context->mailbox->vcount++;
Context->vsize += (body->length + body->offset - body->hdr_offset);
}
}
mutt_progress_init(&progress, _("Executing command on matching messages..."),
MUTT_PROGRESS_MSG, ReadInc,
- (op == MUTT_LIMIT) ? Context->mailbox->msg_count : Context->vcount);
+ (op == MUTT_LIMIT) ? Context->mailbox->msg_count :
+ Context->mailbox->vcount);
if (op == MUTT_LIMIT)
{
- Context->vcount = 0;
+ Context->mailbox->vcount = 0;
Context->vsize = 0;
Context->collapsed = false;
padding = mx_msg_padding_size(Context);
if (mutt_pattern_exec(pat, MUTT_MATCH_FULL_ADDRESS, Context,
Context->mailbox->hdrs[i], NULL))
{
- Context->mailbox->hdrs[i]->virtual = Context->vcount;
+ Context->mailbox->hdrs[i]->virtual = Context->mailbox->vcount;
Context->mailbox->hdrs[i]->limited = true;
- Context->v2r[Context->vcount] = i;
- Context->vcount++;
+ Context->mailbox->v2r[Context->mailbox->vcount] = i;
+ Context->mailbox->vcount++;
struct Body *b = Context->mailbox->hdrs[i]->content;
Context->vsize += b->length + b->offset - b->hdr_offset + padding;
}
}
else
{
- for (int i = 0; i < Context->vcount; i++)
+ for (int i = 0; i < Context->mailbox->vcount; i++)
{
mutt_progress_update(&progress, i, -1);
if (mutt_pattern_exec(pat, MUTT_MATCH_FULL_ADDRESS, Context,
- Context->mailbox->hdrs[Context->v2r[i]], NULL))
+ Context->mailbox->hdrs[Context->mailbox->v2r[i]], NULL))
{
switch (op)
{
case MUTT_UNDELETE:
- mutt_set_flag(Context, Context->mailbox->hdrs[Context->v2r[i]], MUTT_PURGE, 0);
+ mutt_set_flag(Context, Context->mailbox->hdrs[Context->mailbox->v2r[i]],
+ MUTT_PURGE, 0);
/* fallthrough */
case MUTT_DELETE:
- mutt_set_flag(Context, Context->mailbox->hdrs[Context->v2r[i]],
+ mutt_set_flag(Context, Context->mailbox->hdrs[Context->mailbox->v2r[i]],
MUTT_DELETE, (op == MUTT_DELETE));
break;
case MUTT_TAG:
case MUTT_UNTAG:
- mutt_set_flag(Context, Context->mailbox->hdrs[Context->v2r[i]],
+ mutt_set_flag(Context, Context->mailbox->hdrs[Context->mailbox->v2r[i]],
MUTT_TAG, (op == MUTT_TAG));
break;
}
if (Context->limit_pattern)
mutt_pattern_free(&Context->limit_pattern);
- if (Context->mailbox->msg_count && !Context->vcount)
+ if (Context->mailbox->msg_count && !Context->mailbox->vcount)
mutt_error(_("No messages matched criteria"));
/* record new limit pattern, unless match all */
incr = -incr;
mutt_progress_init(&progress, _("Searching..."), MUTT_PROGRESS_MSG, ReadInc,
- Context->vcount);
+ Context->mailbox->vcount);
- for (int i = cur + incr, j = 0; j != Context->vcount; j++)
+ for (int i = cur + incr, j = 0; j != Context->mailbox->vcount; j++)
{
const char *msg = NULL;
mutt_progress_update(&progress, j, -1);
- if (i > Context->vcount - 1)
+ if (i > Context->mailbox->vcount - 1)
{
i = 0;
if (WrapSearch)
}
else if (i < 0)
{
- i = Context->vcount - 1;
+ i = Context->mailbox->vcount - 1;
if (WrapSearch)
msg = _("Search wrapped to bottom");
else
}
}
- struct Header *h = Context->mailbox->hdrs[Context->v2r[i]];
+ struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[i]];
if (h->searched)
{
/* if we've already evaluated this message, use the cached value */
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, c ? Context->vcount : m->msg_count);
+ snprintf(buf, buflen, fmt, c ? Context->mailbox->vcount : m->msg_count);
}
- else if ((c && Context->vcount == m->msg_count) || !c)
+ else if ((c && Context->mailbox->vcount == m->msg_count) || !c)
optional = 0;
break;
* deleted all the messages. the virtual message numbers are not updated
* in that routine, so we must make sure to zero the vcount member.
*/
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
ctx->vsize = 0;
mutt_clear_threads(ctx);
return; /* nothing to do! */
sizeof(struct Header *), sortfunc);
/* adjust the virtual message numbers */
- ctx->vcount = 0;
+ ctx->mailbox->vcount = 0;
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
struct Header *cur = ctx->mailbox->hdrs[i];
if (cur->virtual != -1 || (cur->collapsed && (!ctx->pattern || cur->limited)))
{
- cur->virtual = ctx->vcount;
- ctx->v2r[ctx->vcount] = i;
- ctx->vcount++;
+ cur->virtual = ctx->mailbox->vcount;
+ ctx->mailbox->v2r[ctx->mailbox->vcount] = i;
+ ctx->mailbox->vcount++;
}
cur->msgno = i;
}
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->vcount : 0);
+ snprintf(buf, buflen, fmt, Context ? Context->mailbox->vcount : 0);
}
else if (!Context || !Context->pattern)
optional = 0;