diff options
author | Milan Crha <mcrha@redhat.com> | 2007-11-23 17:06:00 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2007-11-23 17:06:00 +0800 |
commit | 1c88010c53f9a9b7466745041bf55d646bc2aa0a (patch) | |
tree | 60d7111e61e7a58b24ae8e1cdfca8645bb8c1835 /mail/em-folder-view.c | |
parent | c67cc6aa87d39bf8ac6d77c54b99dc9d71dc10ac (diff) | |
download | gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.tar gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.tar.gz gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.tar.bz2 gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.tar.lz gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.tar.xz gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.tar.zst gsoc2013-evolution-1c88010c53f9a9b7466745041bf55d646bc2aa0a.zip |
** Fix for bug #335931
2007-11-23 Milan Crha <mcrha@redhat.com>
** Fix for bug #335931
* message-list.c: (struct _regen_list_msg): New member last_row.
* message-list.c: (regen_list_regen): Store last_row for later use.
* message-list.c: (regen_list_regened): Restore row based on last_row
when no uid was selected before.
* message-list.c: (mail_regen_list): Init new last_row member.
* em-folder-view.c: (emfv_select_next_message): New helper function
to select messages in list.
* em-folder-view.c: (emfv_popup_mark_junk), (emfv_popup_mark_nojunk),
(emfv_popup_delete): Using new helper function, so get same behavior.
* message-list.h: (struct _MessageList):
* message-list.c: (on_cursor_activated_cmd): Removed cursor_row member.
svn path=/trunk/; revision=34567
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 0d7eed1236..614264f547 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -1007,6 +1007,15 @@ emfv_popup_mark_unimportant(EPopup *ep, EPopupItem *pitem, void *data) } static void +emfv_select_next_message (EMFolderView *emfv, int count, gboolean always_can_previous) +{ + if (emfv && count == 1) { + if (!message_list_select (emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0) && (emfv->hide_deleted || always_can_previous)) + message_list_select (emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0); + } +} + +static void emfv_popup_mark_junk (EPopup *ep, EPopupItem *pitem, void *data) { EMFolderView *emfv = data; @@ -1015,8 +1024,8 @@ emfv_popup_mark_junk (EPopup *ep, EPopupItem *pitem, void *data) count = em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN); - if (count == 1) - message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0); + + emfv_select_next_message (emfv, count, TRUE); } static void @@ -1028,8 +1037,8 @@ emfv_popup_mark_nojunk (EPopup *ep, EPopupItem *pitem, void *data) count = em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN, CAMEL_MESSAGE_JUNK_LEARN); - if (count == 1) - message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0); + + emfv_select_next_message (emfv, count, TRUE); } #define DelInVFolderCheckName "DelInVFolderCheck" @@ -1086,10 +1095,7 @@ emfv_delete_msg_response (GtkWidget *dialog, int response, gpointer data) message_list_free_uids(emfv->list, uids); camel_folder_thaw(emfv->folder); - if (count == 1) { - if (!message_list_select (emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0) && emfv->hide_deleted) - message_list_select (emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0); - } + emfv_select_next_message (emfv, count, FALSE); } if (dialog) |