aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-07 05:33:07 +0800
committerDan Winship <danw@src.gnome.org>2000-07-07 05:33:07 +0800
commit647cc8b6365be0a5b754adeb7912904ecfb655ca (patch)
tree5b2aff04c81d1665eb85d933421aaefedb05ebb8 /mail/message-list.c
parent5eae81928c7cb0507a4f0d5ff72bafce84baa394 (diff)
downloadgsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.tar
gsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.tar.gz
gsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.tar.bz2
gsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.tar.lz
gsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.tar.xz
gsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.tar.zst
gsoc2013-evolution-647cc8b6365be0a5b754adeb7912904ecfb655ca.zip
New function to select the first message on or after the given row that
* message-list.c (message_list_select_next): New function to select the first message on or after the given row that meets certain flag criteria. * folder-browser.c (etable_key): call message_list_select_next to select next non-deleted message after Delete. * mail-ops.c (real_fetch_mail): call message_list_select_next to select first unread message in current folder if it changes. (real_delete_msg): Remove the code to move the etable cursor. It only makes sense really if you deleted the message with the keyboard, so do it from there. svn path=/trunk/; revision=3927
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index f12fec302b..34f4e078a0 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -139,6 +139,37 @@ get_message_row (MessageList *message_list, const char *uid)
return -1;
}
+/**
+ * message_list_select_next:
+ * @message_list: a MessageList
+ * @row: the row to start from
+ * @flags: a set of flag values
+ * @mask: a mask for comparing against @flags
+ *
+ * This moves the message list selection to the first row on or after
+ * @row whose flags match @flags when masked with @mask.
+ **/
+void
+message_list_select_next (MessageList *message_list, int row,
+ guint32 flags, guint32 mask)
+{
+ CamelMessageInfo *info;
+
+ while ((info = get_message_info (message_list, row))) {
+ if ((info->flags & mask) == flags) {
+ e_table_set_cursor_row (E_TABLE (message_list->etable),
+ row);
+ return;
+ }
+ row++;
+ }
+
+ /* We know "row" is out of bounds now, so this will cause the
+ * MailDisplay to be cleared.
+ */
+ select_msg (message_list, row);
+}
+
static gint
mark_msg_seen (gpointer data)
{