diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-13 07:00:09 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-13 07:00:09 +0800 |
commit | b663d51f1bd01979030b8dff57a2631cd672775e (patch) | |
tree | 40648b9162fb41c49ae5bf20f3bbc24b0b030bea /plugins | |
parent | 8ff0684fa2e371a80cca60e8df167cc104c473c2 (diff) | |
download | gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.tar gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.tar.gz gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.tar.bz2 gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.tar.lz gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.tar.xz gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.tar.zst gsoc2013-evolution-b663d51f1bd01979030b8dff57a2631cd672775e.zip |
Miscellaneous cleanups.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mailing-list-actions/mailing-list-actions.c | 9 | ||||
-rw-r--r-- | plugins/templates/templates.c | 35 |
2 files changed, 28 insertions, 16 deletions
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index 310c9affce..f97463249c 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -228,18 +228,21 @@ emla_list_action (EMailReader *reader, CamelFolder *folder; GPtrArray *uids; emla_action_data *data; + const gchar *message_uid; folder = e_mail_reader_get_folder (reader); - uids = e_mail_reader_get_selected_uids (reader); + g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (uids->len == 1); + 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); data = g_malloc (sizeof (emla_action_data)); data->reader = g_object_ref (reader); data->action = action; mail_get_message ( - folder, uids->pdata[0], + folder, message_uid, emla_list_action_do, data, mail_msg_unordered_push); diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 48a3b9e5a7..5fa60175b9 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -812,45 +812,54 @@ create_new_message (CamelFolder *folder, const gchar *uid, CamelMimeMessage *mes static void action_reply_with_template_cb (GtkAction *action, - EShellView *shell_view) + EShellView *shell_view) { CamelFolder *folder, *template_folder; EShellContent *shell_content; + CamelMimeMessage *template; EMailReader *reader; GPtrArray *uids; - const gchar *uid; - CamelMimeMessage *template; + const gchar *message_uid; + const gchar *template_uid; shell_content = e_shell_view_get_shell_content (shell_view); reader = E_MAIL_READER (shell_content); + folder = e_mail_reader_get_folder (reader); + g_return_if_fail (CAMEL_IS_FOLDER (folder)); + 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 || !folder) - return; + g_object_ref (action); - g_object_ref (G_OBJECT (action)); + template_folder = g_object_get_data ( + G_OBJECT (action), "template-folder"); + template_uid = g_object_get_data ( + G_OBJECT (action), "template-uid"); - template_folder = g_object_get_data (G_OBJECT (action), "template-folder"); - uid = g_object_get_data (G_OBJECT (action), "template-uid"); - template = camel_folder_get_message_sync (template_folder, uid, NULL, NULL); + /* FIXME This blocks. */ + template = camel_folder_get_message_sync ( + template_folder, template_uid, NULL, NULL); - mail_get_message (folder, uids->pdata[0], create_new_message, + mail_get_message ( + folder, message_uid, create_new_message, (gpointer) template, mail_msg_unordered_push); - g_object_unref (G_OBJECT (action)); + g_object_unref (action); em_utils_uids_free (uids); } static void build_template_menus_recurse (GtkUIManager *ui_manager, - GtkActionGroup *action_group, + GtkActionGroup *action_group, const gchar *menu_path, guint *action_count, guint merge_id, CamelFolderInfo *folder_info, - EShellView *shell_view) + EShellView *shell_view) { CamelStore *store; EShellWindow *shell_window = e_shell_view_get_shell_window (shell_view); |