diff options
author | Milan Crha <mcrha@redhat.com> | 2014-05-06 22:27:01 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-05-06 22:27:01 +0800 |
commit | 4c610e4945ed1c6d4b03078cd1490063bf58662a (patch) | |
tree | 196c7f162e0d20235f18dd5a7ec838b47d4c2c03 | |
parent | c2de4087369147ed6797f6b7866629ff9da19dfc (diff) | |
download | gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.tar gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.tar.gz gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.tar.bz2 gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.tar.lz gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.tar.xz gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.tar.zst gsoc2013-evolution-4c610e4945ed1c6d4b03078cd1490063bf58662a.zip |
Bug #666142 - Filtered message not opened in a separate window
-rw-r--r-- | mail/e-mail-browser.c | 2 | ||||
-rw-r--r-- | mail/e-mail-browser.h | 2 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 10 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 9 | ||||
-rw-r--r-- | mail/message-list.c | 11 |
5 files changed, 21 insertions, 13 deletions
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 8d0982d52c..c281e9433f 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -1040,8 +1040,6 @@ e_mail_browser_init (EMailBrowser *browser) 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 --git a/mail/e-mail-browser.h b/mail/e-mail-browser.h index 4087b980ac..54b6748343 100644 --- a/mail/e-mail-browser.h +++ b/mail/e-mail-browser.h @@ -61,8 +61,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); void e_mail_browser_ask_close_on_reply diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index c6bdebbfb8..07ac1928f6 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -879,17 +879,15 @@ e_mail_reader_open_selected (EMailReader *reader) 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 --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 3cc8814a6d..d5ba9d762f 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -1658,6 +1658,7 @@ action_mail_show_source_cb (GtkAction *action, EActivity *activity; GCancellable *cancellable; EMailReaderClosure *closure; + MessageList *ml; backend = e_mail_reader_get_backend (reader); folder = e_mail_reader_ref_folder (reader); @@ -1665,10 +1666,14 @@ action_mail_show_source_cb (GtkAction *action, 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 --git a/mail/message-list.c b/mail/message-list.c index 7883e5c156..571788b6c1 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -460,6 +460,9 @@ regen_data_new (MessageList *message_list, regen_data->message_list = g_object_ref (message_list); regen_data->last_row = -1; + if (message_list->just_set_folder) + regen_data->select_uid = g_strdup (message_list->cursor_uid); + g_mutex_init (®en_data->select_lock); session = message_list_get_session (message_list); @@ -1064,6 +1067,12 @@ message_list_select_uid (MessageList *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, + signals[MESSAGE_SELECTED], 0, message_list->cursor_uid); } else { g_free (message_list->cursor_uid); message_list->cursor_uid = NULL; @@ -5248,7 +5257,7 @@ message_list_regen_tweak_search_results (MessageList *message_list, * Include the displayed message anyway so it doesn't suddenly * disappear while the user is reading it. */ needs_tweaking = - (folder_changed && message_list->cursor_uid != NULL); + ((folder_changed || message_list->just_set_folder) && message_list->cursor_uid != NULL); if (!needs_tweaking) return; |