From e5e6107537c6689d2a02a1ed9365ea0a5c84c210 Mon Sep 17 00:00:00 2001 From: Bharath Acharya Date: Thu, 16 Oct 2008 05:41:39 +0000 Subject: ** Fix for bug #556284 2008-10-15 Bharath Acharya ** Fix for bug #556284 * templates.c: (reply_with_template), * (org_gnome_templates_popup), (action_template_cb): Fixes for fetching the store using mail_component_peek_local_store. Fixes the right-click crash issues caused on OS_WIN32 by Templates plugin. svn path=/trunk/; revision=36620 --- plugins/templates/templates.c | 42 ++++++------------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'plugins/templates/templates.c') diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 3c79bbcd01..8996c7f8c1 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -31,15 +31,13 @@ #include #include -#include -#include #include #include -#include #include #include #include +#include #include #include #include @@ -502,21 +500,13 @@ static void reply_with_template (EPopup *ep, EPopupItem *item, void *data) { CamelMimeMessage *new, *template, *reply_to; - CamelStore *store; CamelFolder *templates_folder; struct _camel_header_raw *header; UserData *userdata = item->user_data; - char *cont, *basedir, *url; + char *cont; /* We get the templates folder and all the uids of the messages in there */ - basedir = g_build_filename (g_get_home_dir (), ".evolution", "mail", "local", NULL); - url = g_strdup_printf ("mbox://%s", basedir); - g_free (basedir); - - store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, NULL); - g_free (url); - - templates_folder = camel_store_get_folder (store, _("Templates"), CAMEL_STORE_FOLDER_CREATE, NULL); + templates_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_TEMPLATES); /* Get from the currently selected folder, the currently selected message */ reply_to = camel_folder_get_message (userdata->t->folder, @@ -672,21 +662,13 @@ org_gnome_templates_popup (EPlugin *ep, EMPopupTargetSelect *t) CamelFolder *templates_folder; CamelFolderInfo *templates_info; CamelStore *store; - char *basedir; - char *url; GSList *list = NULL; /* We get the templates folder and all the uids of the messages in there */ - basedir = g_build_filename (g_get_home_dir (), ".evolution", "mail", "local", NULL); - url = g_strdup_printf ("mbox://%s", basedir); - - g_free (basedir); - - store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, NULL); - g_free (url); + store = mail_component_peek_local_store (NULL); - templates_folder = camel_store_get_folder (store, _("Templates"), CAMEL_STORE_FOLDER_CREATE, NULL); + templates_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_TEMPLATES); templates_info = camel_store_get_folder_info (store, templates_folder->full_name, @@ -707,22 +689,10 @@ action_template_cb (GtkAction *action, { CamelMessageInfo *info; CamelMimeMessage *msg; - CamelStore *store; CamelFolder *templates_folder; - char *basedir; - char *url; - /* We get the templates folder and all the uids of the messages in there */ - basedir = g_build_filename (g_get_home_dir (), ".evolution", "mail", "local", NULL); - url = g_strdup_printf ("mbox://%s", basedir); - g_free (basedir); - - store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, NULL); - g_free (url); - - templates_folder = camel_store_get_folder (store, _("Templates"), CAMEL_STORE_FOLDER_CREATE, NULL); - + templates_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_TEMPLATES); msg = e_msg_composer_get_message_draft (composer); info = camel_message_info_new (NULL); -- cgit