diff options
author | Milan Crha <mcrha@redhat.com> | 2011-09-26 17:02:47 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-09-26 17:02:47 +0800 |
commit | 8a309aef81ed8364b054e49cfb94908623e2d0d4 (patch) | |
tree | e9966d87808cd4a4042d712cd0344ad65216188f /plugins/mail-to-task | |
parent | 7e1d3d6dbccda146ff513793720d2470f3f13f3e (diff) | |
download | gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.tar gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.tar.gz gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.tar.bz2 gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.tar.lz gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.tar.xz gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.tar.zst gsoc2013-evolution-8a309aef81ed8364b054e49cfb94908623e2d0d4.zip |
Bug #655252 - Need to escape the comp_uid part of a path
Diffstat (limited to 'plugins/mail-to-task')
-rw-r--r-- | plugins/mail-to-task/mail-to-task.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index eb9e762b75..1d9f1fa0d0 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -37,6 +37,7 @@ #include <libecal/e-cal-client.h> #include <libecal/e-cal-component.h> #include <libedataserver/e-account.h> +#include <libedataserver/e-data-server-util.h> #include <libedataserver/e-flag.h> #include <libedataserverui/e-source-selector-dialog.h> #include <libedataserverui/e-client-utils.h> @@ -400,8 +401,8 @@ set_attachments (ECalClient *client, GSList *uri_list = NULL; const gchar *comp_uid = NULL; const gchar *local_store; + gchar *filename_prefix, *tmp; gint ii, n_parts; - gchar *path; struct _att_async_cb_data cb_data; cb_data.flag = e_flag_new (); @@ -416,11 +417,15 @@ set_attachments (ECalClient *client, return; e_cal_component_get_uid (comp, &comp_uid); - local_store = e_cal_client_get_local_attachment_store (client); - path = g_build_path ("/", local_store, comp_uid, NULL); + g_return_if_fail (comp_uid != NULL); - destination = g_file_new_for_path (path); - g_free (path); + tmp = g_strdup (comp_uid); + e_filename_make_safe (tmp); + filename_prefix = g_strconcat (tmp, "-", NULL); + g_free (tmp); + + local_store = e_cal_client_get_local_attachment_store (client); + destination = g_file_new_for_path (local_store); /* Create EAttachments from the MIME parts and add them to the * attachment store. */ @@ -457,8 +462,10 @@ set_attachments (ECalClient *client, e_flag_clear (cb_data.flag); e_attachment_store_save_async ( - store, destination, (GAsyncReadyCallback) - attachment_save_finished, &cb_data); + store, destination, filename_prefix, + (GAsyncReadyCallback) attachment_save_finished, &cb_data); + + g_free (filename_prefix); /* We can't return until we have results. */ e_flag_wait (cb_data.flag); |