aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-01-24 11:09:39 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-01-24 11:09:39 +0800
commite953820d261cf20176cd62f08b4212a676e8edec (patch)
tree3bbb78a492aa2558bef3d661c40fd715342d541f
parent8e301ae2a75d44f6f97270c37ee4abcac12e181f (diff)
downloadgsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.tar
gsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.tar.gz
gsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.tar.bz2
gsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.tar.lz
gsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.tar.xz
gsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.tar.zst
gsoc2013-evolution-e953820d261cf20176cd62f08b4212a676e8edec.zip
** Fix for bug #337046
2008-01-22 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #337046 * gui/dialogs/comp-editor.c: (get_attachment_list): Have a ticking filename for attachment, if the mime doesn't carry it. svn path=/trunk/; revision=34875
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/dialogs/comp-editor.c13
2 files changed, 17 insertions, 3 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 70651d79e0..a873c137c2 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-22 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #337046
+
+ * gui/dialogs/comp-editor.c: (get_attachment_list): Have a ticking
+ filename for attachment, if the mime doesn't carry it.
+
2008-01-17 Dan Winship <danw@gnome.org>
* gui/itip-utils.c (itip_publish_comp): Port to libsoup 2.4. Plug
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 6ddfdb6719..28f2751295 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -643,7 +643,7 @@ get_attachment_list (CompEditor *editor)
GSList *parts = NULL, *list = NULL, *p = NULL;
const char *comp_uid = NULL;
const char *local_store = e_cal_get_local_attachment_store (editor->priv->client);
-
+ int ticker=0;
e_cal_component_get_uid (editor->priv->comp, &comp_uid);
parts = e_attachment_bar_get_parts((EAttachmentBar *)editor->priv->attachment_bar);
@@ -661,9 +661,16 @@ get_attachment_list (CompEditor *editor)
* as a mime part file into the directory denoting the
* calendar source */
utf8_safe_fname = camel_file_util_safe_filename (camel_mime_part_get_filename ((CamelMimePart *) p->data));
- safe_fname = g_filename_from_utf8 ((const char *) utf8_safe_fname, -1, NULL, NULL, NULL);
- g_free (utf8_safe_fname);
+ /* It is absolutely fine to get a NULL from the filename of
+ * mime part. We assume that it is named "Attachment"
+ * in mailer. I'll do that with a ticker */
+ if (!utf8_safe_fname)
+ safe_fname = g_strdup_printf ("%s-%d", _("attachment"), ticker++);
+ else {
+ safe_fname = g_filename_from_utf8 ((const char *) utf8_safe_fname, -1, NULL, NULL, NULL);
+ g_free (utf8_safe_fname);
+ }
filename = g_strdup_printf ("%s-%s", comp_uid, safe_fname);
attach_file_url = g_build_path ("/", local_store, filename, NULL);