aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-09-26 17:02:47 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-26 18:56:07 +0800
commit981d3d17680fd8592c8593732b2640f17ad6d572 (patch)
tree6403bf230581a6ffd8b10d19828137441e5d4c58 /calendar/gui
parent11e79dc02700a90e70c81d00c250e3d72c4db790 (diff)
downloadgsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.tar
gsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.tar.gz
gsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.tar.bz2
gsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.tar.lz
gsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.tar.xz
gsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.tar.zst
gsoc2013-evolution-981d3d17680fd8592c8593732b2640f17ad6d572.zip
Bug #655252 - Need to escape the comp_uid part of a path
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/comp-editor.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index eaf779df33..fc062a0de9 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -43,6 +43,7 @@
#include <e-util/e-util-private.h>
#include <shell/e-shell.h>
+#include <libedataserver/e-data-server-util.h>
#include <libecal/e-cal-client.h>
#include <libecal/e-cal-client-view.h>
@@ -302,7 +303,7 @@ get_attachment_list (CompEditor *editor)
GSList *list = NULL;
const gchar *comp_uid = NULL;
const gchar *local_store;
- gchar *path;
+ gchar *filename_prefix, *tmp;
gint ii;
struct {
@@ -311,6 +312,9 @@ get_attachment_list (CompEditor *editor)
GtkWindow *parent;
} status;
+ e_cal_component_get_uid (editor->priv->comp, &comp_uid);
+ g_return_val_if_fail (comp_uid != NULL, NULL);
+
status.uris = NULL;
status.done = FALSE;
status.parent = g_object_ref (editor);
@@ -318,17 +322,20 @@ get_attachment_list (CompEditor *editor)
view = E_ATTACHMENT_VIEW (editor->priv->attachment_view);
store = e_attachment_view_get_store (view);
+ 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 (editor->priv->cal_client);
- e_cal_component_get_uid (editor->priv->comp, &comp_uid);
- path = g_build_path ("/", local_store, comp_uid, NULL);
- destination = g_file_new_for_path (path);
- g_free (path);
+ destination = g_file_new_for_path (local_store);
e_attachment_store_save_async (
- store, destination, (GAsyncReadyCallback)
- attachment_save_finished, &status);
+ store, destination, filename_prefix,
+ (GAsyncReadyCallback) attachment_save_finished, &status);
g_object_unref (destination);
+ g_free (filename_prefix);
/* We can't return until we have results, so crank
* the main loop until the callback gets triggered. */