static int select_next (void);
-enum {
- SB_SRC_NONE = 0,
- SB_SRC_VIRT,
- SB_SRC_INCOMING
+enum
+{
+ SB_SRC_NONE = 0,
+ SB_SRC_VIRT,
+ SB_SRC_INCOMING
};
static int sidebar_source = SB_SRC_NONE;
static BUFFY *
get_incoming (void)
{
- switch (sidebar_source) {
- case SB_SRC_NONE:
- sidebar_source = SB_SRC_INCOMING;
+ switch (sidebar_source)
+ {
+ case SB_SRC_NONE:
+ sidebar_source = SB_SRC_INCOMING;
#ifdef USE_NOTMUCH
- if (option (OPTVIRTSPOOLFILE) && VirtIncoming) {
- sidebar_source = SB_SRC_VIRT;
- return VirtIncoming;
- }
- break;
- case SB_SRC_VIRT:
- if (VirtIncoming) {
- return VirtIncoming;
- }
- break;
+ if (option (OPTVIRTSPOOLFILE) && VirtIncoming)
+ {
+ sidebar_source = SB_SRC_VIRT;
+ return VirtIncoming;
+ }
+ break;
+ case SB_SRC_VIRT:
+ if (VirtIncoming)
+ {
+ return VirtIncoming;
+ }
+ break;
#endif
- case SB_SRC_INCOMING:
- break;
- }
+ case SB_SRC_INCOMING:
+ break;
+ }
- return Incoming; /* default */
+ return Incoming; /* default */
}
/**
if (!sbe || !dest)
return src;
- dest[0] = 0; /* Just in case there's nothing to do */
+ dest[0] = 0; /* Just in case there's nothing to do */
BUFFY *b = sbe->buffy;
if (!b)
* @b: Second SBENTRY to compare
*
* Returns:
- * -1: a precedes b
- * 0: a and b are identical
- * 1: b precedes a
+ * -1: a precedes b
+ * 0: a and b are identical
+ * 1: b precedes a
*/
static int cb_qsort_sbe (const void *a, const void *b)
{
*
* For each SBENTRY in the Entries array, check whether we should display it.
* This is determined by several criteria. If the BUFFY:
- * is the currently open mailbox
- * is the currently highlighted mailbox
- * has unread messages
- * has flagged messages
- * is whitelisted
+ * is the currently open mailbox
+ * is the currently highlighted mailbox
+ * has unread messages
+ * has flagged messages
+ * is whitelisted
*/
static void update_entries_visibility (void)
{
* can change outside of the sidebar that we don't hear about.
*
* Returns:
- * 0: No, don't draw the sidebar
- * 1: Yes, draw the sidebar
+ * 0: No, don't draw the sidebar
+ * 1: Yes, draw the sidebar
*/
static int prepare_sidebar (int page_size)
{
* option "sidebar_width".
*
* Returns:
- * -1: Error: bad character, etc
- * 0: Error: 0 width character
- * n: Success: character occupies n screen columns
+ * -1: Error: bad character, etc
+ * 0: Error: 0 width character
+ * n: Success: character occupies n screen columns
*/
static int draw_divider (int num_rows, int num_cols)
{
SETCOLOR(MT_COLOR_DIVIDER);
int col;
- if (option (OPTSIDEBARONRIGHT)) {
+ if (option (OPTSIDEBARONRIGHT))
col = 0;
- } else {
+ else
col = SidebarWidth - delim_len;
- }
int i;
for (i = 0; i < num_rows; i++)
}
int col = 0;
- if (option (OPTSIDEBARONRIGHT)) {
+ if (option (OPTSIDEBARONRIGHT))
col = div_width;
- }
mutt_window_move (MuttSidebarWindow, row, col);
if (Context && Context->realpath &&
* Search down the list of mail folders for one containing new mail.
*
* Returns:
- * 1: Success
- * 0: Failure
+ * 1: Success
+ * 0: Failure
*/
static int select_next_new (void)
{
* Search up the list of mail folders for one containing new mail.
*
* Returns:
- * 1: Success
- * 0: Failure
+ * 1: Success
+ * 0: Failure
*/
static int select_prev_new (void)
{
if (!option (OPTSIDEBAR))
return;
- if (HilIndex < 0) /* It'll get reset on the next draw */
+ if (HilIndex < 0) /* It'll get reset on the next draw */
return;
switch (op)
* Get the path of the mailbox that's highlighted in the sidebar.
*
* Returns:
- * Mailbox path
+ * Mailbox path
*/
const char *mutt_sb_get_highlight (void)
{
* mutt_sb_notify_mailbox - The state of a BUFFY is about to change
*
* We receive a notification:
- * After a new BUFFY has been created
- * Before a BUFFY is deleted
+ * After a new BUFFY has been created
+ * Before a BUFFY is deleted
*
* Before a deletion, check that our pointers won't be invalidated.
*/
void
mutt_sb_toggle_virtual (void)
{
- if (sidebar_source == -1)
- get_incoming();
+ if (sidebar_source == -1)
+ get_incoming();
#ifdef USE_NOTMUCH
- if ((sidebar_source == SB_SRC_INCOMING) && VirtIncoming)
- sidebar_source = SB_SRC_VIRT;
- else
+ if ((sidebar_source == SB_SRC_INCOMING) && VirtIncoming)
+ sidebar_source = SB_SRC_VIRT;
+ else
#endif
- sidebar_source = SB_SRC_INCOMING;
+ sidebar_source = SB_SRC_INCOMING;
- TopIndex = -1;
- OpnIndex = -1;
- HilIndex = -1;
- BotIndex = -1;
+ TopIndex = -1;
+ OpnIndex = -1;
+ HilIndex = -1;
+ BotIndex = -1;
- BUFFY *b;
+ BUFFY *b;
- EntryCount = 0;
- FREE(&Entries);
- EntryLen = 0;
- for (b = get_incoming(); b; b = b->next)
- mutt_sb_notify_mailbox (b, 1);
+ EntryCount = 0;
+ FREE(&Entries);
+ EntryLen = 0;
+ for (b = get_incoming(); b; b = b->next)
+ mutt_sb_notify_mailbox (b, 1);
- SidebarNeedsRedraw = 1;
+ SidebarNeedsRedraw = 1;
}