aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/templates
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-13 07:00:09 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-13 07:00:09 +0800
commitb663d51f1bd01979030b8dff57a2631cd672775e (patch)
tree40648b9162fb41c49ae5bf20f3bbc24b0b030bea /plugins/templates
parent8ff0684fa2e371a80cca60e8df167cc104c473c2 (diff)
downloadgsoc2013-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/templates')
-rw-r--r--plugins/templates/templates.c35
1 files changed, 22 insertions, 13 deletions
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);