diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-13 07:00:09 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:15 +0800 |
commit | 1a75a7d808c45cbc2c3c4b0cc6b750ef4002ed8e (patch) | |
tree | fe6d60ada01d8a993b45372b8b4a3e2759bec174 /modules/mail | |
parent | 0477a65401f042cfbae9a636ab76b89f25a6468a (diff) | |
download | gsoc2013-evolution-1a75a7d808c45cbc2c3c4b0cc6b750ef4002ed8e.tar.gz gsoc2013-evolution-1a75a7d808c45cbc2c3c4b0cc6b750ef4002ed8e.tar.zst gsoc2013-evolution-1a75a7d808c45cbc2c3c4b0cc6b750ef4002ed8e.zip |
Miscellaneous cleanups.
Diffstat (limited to 'modules/mail')
-rw-r--r-- | modules/mail/e-mail-attachment-handler.c | 6 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 42 |
2 files changed, 28 insertions, 20 deletions
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c index befac08d30..6b2efaf1c7 100644 --- a/modules/mail/e-mail-attachment-handler.c +++ b/modules/mail/e-mail-attachment-handler.c @@ -323,9 +323,13 @@ mail_attachment_handler_x_uid_list (EAttachmentView *view, /* Handle one message. */ if (uids->len == 1) { + const gchar *message_uid; + + message_uid = g_ptr_array_index (uids, 0); + /* FIXME Not passing a GCancellable here. */ message = camel_folder_get_message_sync ( - folder, uids->pdata[0], NULL, &local_error); + folder, message_uid, NULL, &local_error); if (message == NULL) goto exit; diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index b3cfb7e796..5eb7aca8ca 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -948,6 +948,7 @@ e_mail_shell_view_create_filter_from_selected (EMailShellView *mail_shell_view, EMailView *mail_view; CamelFolder *folder; const gchar *filter_source; + const gchar *message_uid; GPtrArray *uids; struct { @@ -969,7 +970,10 @@ e_mail_shell_view_create_filter_from_selected (EMailShellView *mail_shell_view, reader = E_MAIL_READER (mail_view); folder = e_mail_reader_get_folder (reader); + uids = e_mail_reader_get_selected_uids (reader); + g_return_if_fail (uids != NULL && uids->len == 1); + message_uid = g_ptr_array_index (uids, 0); if (em_utils_folder_is_sent (folder)) filter_source = E_FILTER_SOURCE_OUTGOING; @@ -978,17 +982,15 @@ e_mail_shell_view_create_filter_from_selected (EMailShellView *mail_shell_view, else filter_source = E_FILTER_SOURCE_INCOMING; - if (uids->len == 1) { - filter_data = g_malloc (sizeof (*filter_data)); - filter_data->session = g_object_ref (session); - filter_data->source = filter_source; - filter_data->type = filter_type; + filter_data = g_malloc (sizeof (*filter_data)); + filter_data->session = g_object_ref (session); + filter_data->source = filter_source; + filter_data->type = filter_type; - mail_get_message ( - folder, uids->pdata[0], - mail_shell_view_create_filter_cb, - filter_data, mail_msg_unordered_push); - } + mail_get_message ( + folder, message_uid, + mail_shell_view_create_filter_cb, + filter_data, mail_msg_unordered_push); em_utils_uids_free (uids); } @@ -1027,6 +1029,7 @@ e_mail_shell_view_create_vfolder_from_selected (EMailShellView *mail_shell_view, EMailView *mail_view; CamelFolder *folder; GPtrArray *uids; + const gchar *message_uid; struct { EMailSession *session; @@ -1046,18 +1049,19 @@ e_mail_shell_view_create_vfolder_from_selected (EMailShellView *mail_shell_view, reader = E_MAIL_READER (mail_view); folder = e_mail_reader_get_folder (reader); + uids = e_mail_reader_get_selected_uids (reader); + g_return_if_fail (uids != NULL && uids->len == 1); + message_uid = g_ptr_array_index (uids, 0); - if (uids->len == 1) { - vfolder_data = g_malloc (sizeof (*vfolder_data)); - vfolder_data->session = g_object_ref (session); - vfolder_data->type = vfolder_type; + vfolder_data = g_malloc (sizeof (*vfolder_data)); + vfolder_data->session = g_object_ref (session); + vfolder_data->type = vfolder_type; - mail_get_message ( - folder, uids->pdata[0], - mail_shell_view_create_vfolder_cb, - vfolder_data, mail_msg_unordered_push); - } + mail_get_message ( + folder, message_uid, + mail_shell_view_create_vfolder_cb, + vfolder_data, mail_msg_unordered_push); em_utils_uids_free (uids); } |