diff -up evolution-3.8.5/mail/e-mail-browser.c.evo-browser-filtered-1090629 evolution-3.8.5/mail/e-mail-browser.c
--- evolution-3.8.5/mail/e-mail-browser.c.evo-browser-filtered-1090629 2013-07-23 14:51:50.000000000 +0200
+++ evolution-3.8.5/mail/e-mail-browser.c 2014-05-13 14:52:16.545888674 +0200
@@ -1014,8 +1014,6 @@ e_mail_browser_init (EMailBrowser *brows
GtkWidget *
e_mail_browser_new (EMailBackend *backend,
- CamelFolder *folder,
- const gchar *msg_uid,
EMailFormatterMode display_mode)
{
g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL);
diff -up evolution-3.8.5/mail/e-mail-browser.h.evo-browser-filtered-1090629 evolution-3.8.5/mail/e-mail-browser.h
--- evolution-3.8.5/mail/e-mail-browser.h.evo-browser-filtered-1090629 2013-07-23 14:51:53.000000000 +0200
+++ evolution-3.8.5/mail/e-mail-browser.h 2014-05-13 14:52:16.545888674 +0200
@@ -62,8 +62,6 @@ struct _EMailBrowserClass {
GType e_mail_browser_get_type (void);
GtkWidget * e_mail_browser_new (EMailBackend *backend,
- CamelFolder *folder,
- const gchar *message_uid,
EMailFormatterMode display_mode);
void e_mail_browser_close (EMailBrowser *browser);
EMailFormatterMode
diff -up evolution-3.8.5/mail/e-mail-reader-utils.c.evo-browser-filtered-1090629 evolution-3.8.5/mail/e-mail-reader-utils.c
--- evolution-3.8.5/mail/e-mail-reader-utils.c.evo-browser-filtered-1090629 2013-07-23 14:51:51.000000000 +0200
+++ evolution-3.8.5/mail/e-mail-reader-utils.c 2014-05-13 14:52:16.546888674 +0200
@@ -875,17 +875,15 @@ e_mail_reader_open_selected (EMailReader
GtkWidget *browser;
MessageList *ml;
- browser = e_mail_browser_new (
- backend, folder, uid,
- E_MAIL_FORMATTER_MODE_NORMAL);
-
- e_mail_reader_set_folder (E_MAIL_READER (browser), folder);
- e_mail_reader_set_message (E_MAIL_READER (browser), uid);
+ browser = e_mail_browser_new (backend, E_MAIL_FORMATTER_MODE_NORMAL);
ml = MESSAGE_LIST (e_mail_reader_get_message_list (
E_MAIL_READER (browser)));
message_list_freeze (ml);
+ e_mail_reader_set_folder (E_MAIL_READER (browser), folder);
+ e_mail_reader_set_message (E_MAIL_READER (browser), uid);
+
copy_tree_state (reader, E_MAIL_READER (browser));
e_mail_reader_set_group_by_threads (
E_MAIL_READER (browser),
diff -up evolution-3.8.5/mail/e-mail-reader.c.evo-browser-filtered-1090629 evolution-3.8.5/mail/e-mail-reader.c
--- evolution-3.8.5/mail/e-mail-reader.c.evo-browser-filtered-1090629 2014-05-13 14:52:16.534888675 +0200
+++ evolution-3.8.5/mail/e-mail-reader.c 2014-05-13 14:52:16.546888674 +0200
@@ -1772,6 +1772,7 @@ action_mail_show_source_cb (GtkAction *a
EActivity *activity;
GCancellable *cancellable;
EMailReaderClosure *closure;
+ MessageList *ml;
backend = e_mail_reader_get_backend (reader);
folder = e_mail_reader_get_folder (reader);
@@ -1779,10 +1780,14 @@ action_mail_show_source_cb (GtkAction *a
g_return_if_fail (uids != NULL && uids->len == 1);
message_uid = g_ptr_array_index (uids, 0);
- browser = e_mail_browser_new (
- backend, NULL, NULL, E_MAIL_FORMATTER_MODE_SOURCE);
+ browser = e_mail_browser_new (backend, E_MAIL_FORMATTER_MODE_SOURCE);
+ ml = MESSAGE_LIST (e_mail_reader_get_message_list (E_MAIL_READER (browser)));
+
+ message_list_freeze (ml);
e_mail_reader_set_folder (E_MAIL_READER (browser), folder);
e_mail_reader_set_message (E_MAIL_READER (browser), message_uid);
+ message_list_thaw (ml);
+
display = e_mail_reader_get_mail_display (E_MAIL_READER (browser));
string = g_strdup_printf (_("Retrieving message '%s'"), message_uid);
diff -up evolution-3.8.5/mail/message-list.c.evo-browser-filtered-1090629 evolution-3.8.5/mail/message-list.c
--- evolution-3.8.5/mail/message-list.c.evo-browser-filtered-1090629 2014-05-13 14:52:16.543888674 +0200
+++ evolution-3.8.5/mail/message-list.c 2014-05-13 14:52:16.547888674 +0200
@@ -750,6 +750,12 @@ message_list_select_uid (MessageList *me
message_list,
message_list_signals[MESSAGE_SELECTED],
0, message_list->cursor_uid);
+ } else if (message_list->just_set_folder) {
+ g_free (message_list->cursor_uid);
+ message_list->cursor_uid = g_strdup (uid);
+ g_signal_emit (
+ message_list,
+ message_list_signals[MESSAGE_SELECTED], 0, message_list->cursor_uid);
} else {
g_free (message_list->cursor_uid);
message_list->cursor_uid = NULL;
@@ -4903,6 +4909,13 @@ regen_list_done (struct _regen_list_msg
with_fallback = m->ml->pending_select_fallback;
message_list_select_uid (m->ml, uid, with_fallback);
g_free (uid);
+ } else if (m->ml->regen == NULL && m->ml->ensure_uid) {
+ gchar *uid;
+
+ uid = m->ml->ensure_uid;
+ m->ml->ensure_uid = NULL;
+ message_list_select_uid (m->ml, uid, FALSE);
+ 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 (tree);
@@ -4918,6 +4931,8 @@ regen_list_done (struct _regen_list_msg
}
}
+ message_list_ensure_message (m->ml, NULL);
+
if (gtk_widget_get_visible (GTK_WIDGET (m->ml))) {
if (e_tree_row_count (E_TREE (m->ml)) <= 0) {
/* space is used to indicate no search too */
@@ -5079,6 +5094,9 @@ mail_regen_list (MessageList *ml,
m->last_row = -1;
m->expand_state = NULL;
+ if (ml->just_set_folder && ml->cursor_uid)
+ message_list_ensure_message (ml, ml->cursor_uid);
+
if ((!m->hidedel || !m->dotree) && ml->thread_tree) {
camel_folder_thread_messages_unref (ml->thread_tree);
ml->thread_tree = NULL;