aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index e1abf688d7..8c9accb3aa 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -365,9 +365,12 @@ get_message_info (MessageList *message_list, ETreePath node)
* unchanged.
**/
void
-message_list_select (MessageList *message_list, int base_row,
+message_list_select (MessageList *message_list,
+ int base_row,
MessageListSelectDirection direction,
- guint32 flags, guint32 mask)
+ guint32 flags,
+ guint32 mask,
+ gboolean wraparound)
{
CamelMessageInfo *info;
int vrow, last;
@@ -405,8 +408,10 @@ message_list_select (MessageList *message_list, int base_row,
/* We don't know whether to use < or > due to "direction" */
while (vrow != last) {
- ETreePath node = e_tree_node_at_row(et, vrow);
+ ETreePath node = e_tree_node_at_row (et, vrow);
+
info = get_message_info (message_list, node);
+
if (info && (info->flags & mask) == flags) {
e_tree_set_cursor (et, node);
@@ -416,6 +421,15 @@ message_list_select (MessageList *message_list, int base_row,
}
vrow += direction;
}
+
+ if (wraparound) {
+ if (direction > 0)
+ message_list_select (message_list, 0,
+ direction, flags, mask, FALSE);
+ else
+ message_list_select (message_list, e_tree_row_count (et) - 1,
+ direction, flags, mask, FALSE);
+ }
}