aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-08-08 01:03:06 +0800
committerDan Winship <danw@src.gnome.org>2000-08-08 01:03:06 +0800
commit520d69a638ea90f6114a8a7ef296317d64b65393 (patch)
treed0ce75d6299340721cfeab4feb14aff37440fde3 /mail/message-list.c
parentfa019ac64631a7911d31f34747b2d72e7411015e (diff)
downloadgsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.tar
gsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.tar.gz
gsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.tar.bz2
gsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.tar.lz
gsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.tar.xz
gsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.tar.zst
gsoc2013-evolution-520d69a638ea90f6114a8a7ef296317d64b65393.zip
Clarify that the input row is a model row, and swap it to a view row when
* message-list.c (message_list_select): Clarify that the input row is a model row, and swap it to a view row when finding the next/previous row. (idle_select_row): Select view row 0, not model row 0. * mail-ops.c (select_first_unread): Start from view row 0, not model row 0. svn path=/trunk/; revision=4570
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 91a177ffc4..2a390530e4 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -102,7 +102,7 @@ get_message_info (MessageList *message_list, int row)
/**
* message_list_select:
* @message_list: a MessageList
- * @base_row: the row to start from
+ * @base_row: the (model) row to start from
* @direction: the direction to search in
* @flags: a set of flag values
* @mask: a mask for comparing against @flags
@@ -121,19 +121,21 @@ message_list_select (MessageList *message_list, int base_row,
guint32 flags, guint32 mask)
{
const CamelMessageInfo *info;
- int last;
+ int vrow, mrow, last;
+ ETableScrolled *ets = E_TABLE_SCROLLED (message_list->etable);
if (direction == MESSAGE_LIST_SELECT_PREVIOUS)
last = 0;
else
last = e_table_model_row_count (message_list->table_model);
- while (base_row != last) {
- base_row += direction;
- info = get_message_info (message_list, base_row);
+ vrow = e_table_model_to_view_row (ets->table, base_row);
+ while (vrow != last) {
+ vrow += direction;
+ mrow = e_table_view_to_model_row (ets->table, vrow);
+ info = get_message_info (message_list, mrow);
if (info && (info->flags & mask) == flags) {
- e_table_scrolled_set_cursor_row (E_TABLE_SCROLLED (message_list->etable),
- base_row);
+ e_table_scrolled_set_cursor_row (ets, mrow);
return;
}
}
@@ -939,15 +941,21 @@ on_cursor_change_cmd (ETableScrolled *table, int row, gpointer user_data)
info = get_message_info (message_list, row);
message_list->cursor_uid = info ? info->uid : NULL;
- if (!message_list->idle_id)
- message_list->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_change_idle, message_list, NULL);
+ if (!message_list->idle_id) {
+ message_list->idle_id =
+ g_idle_add_full (G_PRIORITY_LOW, on_cursor_change_idle,
+ message_list, NULL);
+ }
}
/* FIXME: this is all a kludge. */
static gint
idle_select_row (gpointer user_data)
{
- e_table_scrolled_set_cursor_row (user_data, 0);
+ ETableScrolled *ets = user_data;
+ int mrow = e_table_view_to_model_row (ets->table, 0);
+
+ e_table_scrolled_set_cursor_row (ets, mrow);
return FALSE;
}