Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:shashish
evolution
bnc-358161-evo-message-list-display-blank.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-358161-evo-message-list-display-blank.diff of Package evolution
--- mail/em-folder-view.c 2008-03-03 17:45:31.000000000 +0530 +++ mail/em-folder-view.c 2008-03-03 19:59:37.000000000 +0530 @@ -918,6 +918,16 @@ emfv_popup_mark_unimportant(EPopup *ep, } 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; @@ -926,8 +936,8 @@ emfv_popup_mark_junk (EPopup *ep, EPopup 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 @@ -939,8 +949,8 @@ emfv_popup_mark_nojunk (EPopup *ep, EPop 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); } static void @@ -974,10 +984,7 @@ emfv_popup_delete(EPopup *ep, EPopupItem 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, TRUE); } static void --- mail/message-list.c 2008-03-03 17:45:32.000000000 +0530 +++ mail/message-list.c 2008-03-03 19:40:02.000000000 +0530 @@ -3145,7 +3145,6 @@ on_cursor_activated_cmd (ETree *tree, in || (message_list->cursor_uid != NULL && new_uid != NULL && !strcmp (message_list->cursor_uid, new_uid))) return; - message_list->cursor_row = row; g_free (message_list->cursor_uid); message_list->cursor_uid = g_strdup (new_uid); @@ -3638,6 +3637,8 @@ struct _regen_list_msg { CamelFolder *folder; GPtrArray *summary; + + int last_row; /* last selected (cursor) row */ }; /* @@ -3662,11 +3663,16 @@ regen_list_regen (struct _mail_msg *mm) struct _regen_list_msg *m = (struct _regen_list_msg *)mm; GPtrArray *uids, *uidnew, *showuids, *searchuids = NULL; CamelMessageInfo *info; + ETreePath cursor; int i; if (m->folder != m->ml->folder) return; + cursor = e_tree_get_cursor (m->ml->tree); + if (cursor) + m->last_row = e_tree_table_adapter_row_of_node(e_tree_get_table_adapter (m->ml->tree), cursor); + e_profile_event_emit("list.getuids", m->folder->full_name, 0); /* if we have hidedeleted on, use a search to find it out, merge with existing search if set */ @@ -3752,10 +3758,22 @@ regen_list_regen (struct _mail_msg *mm) /* first, hide matches */ if (m->ml->hidden) { + int subtr = 0; + for (i = 0; i < uids->len; i++) { if (g_hash_table_lookup (m->ml->hidden, uids->pdata[i]) == 0) g_ptr_array_add (uidnew, uids->pdata[i]); + else if (m->last_row >= 0) { + /* if we are going to hide message above last selected row, then we should + decrease our last row number, to put cursor on a proper place. */ + ETreePath node = g_hash_table_lookup (m->ml->uid_nodemap, (const char *) uids->pdata[i]); + + if (node && m->last_row > e_tree_table_adapter_row_of_node (e_tree_get_table_adapter (m->ml->tree), node)) + subtr ++; + } } + + m->last_row -= subtr; } /* then calculate the subrange visible and chop it out */ @@ -3874,8 +3892,20 @@ regen_list_regened (struct _mail_msg *mm m->ml->pending_select_uid = NULL; message_list_select_uid(m->ml, uid); g_free(uid); - } + } else if (m->ml->regen == NULL && m->ml->cursor_uid == NULL && m->last_row != -1) { + ETreeTableAdapter *etta = e_tree_get_table_adapter (m->ml->tree); + + if (m->last_row >= e_table_model_row_count (E_TABLE_MODEL (etta))) + m->last_row = e_table_model_row_count (E_TABLE_MODEL (etta)) - 1; + if (m->last_row >= 0) { + ETreePath path; + + path = e_tree_table_adapter_node_at_row (etta, m->last_row); + if (path) + select_path (m->ml, path); + } + } g_signal_emit (m->ml, message_list_signals[MESSAGE_LIST_BUILT], 0); } @@ -3999,6 +4029,7 @@ mail_regen_list (MessageList *ml, const g_object_ref(ml); m->folder = ml->folder; camel_object_ref(m->folder); + m->last_row = -1; if ((!m->hidedel || !m->dotree) && ml->thread_tree) { camel_folder_thread_messages_unref(ml->thread_tree); --- mail/message-list.h 2008-03-03 17:45:31.000000000 +0530 +++ mail/message-list.h 2008-03-03 19:40:24.000000000 +0530 @@ -132,7 +132,6 @@ struct _MessageList { guint frozen:16; /* Where the ETree cursor is. */ - int cursor_row; char *cursor_uid; /* Row-selection and seen-marking timers */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor