diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-reader.c | 2 | ||||
-rw-r--r-- | mail/message-list.c | 17 | ||||
-rw-r--r-- | mail/message-list.h | 3 |
3 files changed, 14 insertions, 8 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 094facd7e5..b9e77b825c 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2940,7 +2940,7 @@ mail_reader_set_folder (EMailReader *reader, priv->folder_was_just_selected = (folder != NULL); message_list_set_folder ( - MESSAGE_LIST (message_list), folder, folder_uri, outgoing); + MESSAGE_LIST (message_list), folder, outgoing); mail_reader_emit_folder_loaded (reader); } diff --git a/mail/message-list.c b/mail/message-list.c index 214740b99c..ba1808838b 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -3763,7 +3763,6 @@ folder_changed (CamelFolder *folder, * message_list_set_folder: * @message_list: Message List widget * @folder: folder backend to be set - * @uri: uri of @folder. * @outgoing: whether this is an outgoing folder * * Sets @folder to be the backend folder for @message_list. If @@ -3771,7 +3770,9 @@ folder_changed (CamelFolder *folder, * the "Outgoing folder" column view. **/ void -message_list_set_folder (MessageList *message_list, CamelFolder *folder, const gchar *uri, gboolean outgoing) +message_list_set_folder (MessageList *message_list, + CamelFolder *folder, + gboolean outgoing) { ETreeModel *etm = message_list->model; gboolean hide_deleted; @@ -3818,9 +3819,15 @@ message_list_set_folder (MessageList *message_list, CamelFolder *folder, const g message_list->thread_tree = NULL; } - if (message_list->folder_uri != uri) { - g_free (message_list->folder_uri); - message_list->folder_uri = uri ? g_strdup (uri):NULL; + g_free (message_list->folder_uri); + message_list->folder_uri = NULL; + + /* XXX Not sure if MESSAGE_SELECTED signal handlers rely on + * folder_uri being set, so avoid temptation to move this + * logic down until verifying it's safe. */ + if (CAMEL_IS_FOLDER (folder)) { + const gchar *uri = camel_folder_get_uri (folder); + message_list->folder_uri = g_strdup (uri); } if (message_list->cursor_uid) { diff --git a/mail/message-list.h b/mail/message-list.h index 4ca9015490..699c4ce47f 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -181,8 +181,7 @@ GType message_list_get_type (void); GtkWidget * message_list_new (EMailBackend *backend); EMailBackend * message_list_get_backend (MessageList *message_list); void message_list_set_folder (MessageList *message_list, - CamelFolder *camel_folder, - const gchar *uri, + CamelFolder *folder, gboolean outgoing); GtkTargetList * message_list_get_copy_target_list (MessageList *message_list); |