evolution r37497 - in trunk/widgets: . misc



Author: fujiwarat
Date: Tue Apr  7 11:34:29 2009
New Revision: 37497
URL: http://svn.gnome.org/viewvc/evolution?rev=37497&view=rev

Log:
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.



Modified:
   trunk/widgets/ChangeLog
   trunk/widgets/misc/e-attachment-bar.c

Modified: trunk/widgets/misc/e-attachment-bar.c
==============================================================================
--- trunk/widgets/misc/e-attachment-bar.c	(original)
+++ trunk/widgets/misc/e-attachment-bar.c	Tue Apr  7 11:34:29 2009
@@ -389,7 +389,7 @@
 		CamelContentType *content_type;
 		char *size_string, *label;
 		GdkPixbuf *pixbuf = NULL;
-		const char *desc;
+		char *desc;
 
 		attachment = priv->attachments->pdata[i];
 
@@ -443,20 +443,26 @@
 
 		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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]