aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorTakao Fujiwara <takao.fujiwara@sun.com>2009-04-07 19:34:29 +0800
committerTakao Fujiwara <fujiwarat@src.gnome.org>2009-04-07 19:34:29 +0800
commitc57708891310320ae0160e1fe04e0138c745e7a0 (patch)
treead5a2ad9a670dc840fc93e34659c8f828d4d588d /widgets/misc
parent80b575ffb834f003c7e0742b60ac02d5cb09a43a (diff)
downloadgsoc2013-evolution-c57708891310320ae0160e1fe04e0138c745e7a0.tar.gz
gsoc2013-evolution-c57708891310320ae0160e1fe04e0138c745e7a0.tar.zst
gsoc2013-evolution-c57708891310320ae0160e1fe04e0138c745e7a0.zip
Reviewed by Milan Crha <mcrha@redhat.com> Reviewed by Matthew Barnes
2009-04-07 Takao Fujiwara <takao.fujiwara@sun.com> Reviewed by Milan Crha <mcrha@redhat.com> Reviewed by Matthew Barnes <mbarnes@redhat.com> * Fixes bug #537530 * misc/e-attachment-bar.c (update): Use g_filename_to_utf8 for attachment filenames. svn path=/trunk/; revision=37497
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-attachment-bar.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c
index 2da9d3541c..de45861055 100644
--- a/widgets/misc/e-attachment-bar.c
+++ b/widgets/misc/e-attachment-bar.c
@@ -389,7 +389,7 @@ update (EAttachmentBar *bar)
CamelContentType *content_type;
char *size_string, *label;
GdkPixbuf *pixbuf = NULL;
- const char *desc;
+ char *desc;
attachment = priv->attachments->pdata[i];
@@ -443,20 +443,26 @@ update (EAttachmentBar *bar)
desc = camel_mime_part_get_description (attachment->body);
if (!desc || *desc == '\0') {
- if (attachment->file_name)
- desc = attachment->file_name;
- else
+ if (attachment->file_name) {
+ desc = g_filename_to_utf8 (attachment->file_name, -1, NULL, NULL, NULL);
+ } else {
desc = camel_mime_part_get_filename (attachment->body);
+ if (desc)
+ desc = g_strdup (desc);
+ }
}
if (!desc)
- desc = _("attachment");
+ desc = g_strdup (_("attachment"));
if (attachment->size && (size_string = g_format_size_for_display (attachment->size))) {
label = g_strdup_printf ("%s (%s)", desc, size_string);
+ g_free (desc);
g_free (size_string);
- } else
+ } else {
label = g_strdup (desc);
+ g_free (desc);
+ }
if (pixbuf == NULL) {
char *mime_type;