aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-29 09:13:38 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-29 09:13:38 +0800
commitaaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc (patch)
tree30b7f90a9ba1f5880c5a7e548e27a8b19696c0dc /composer
parent36b0cb239ae498f087f4a9b30fd9377bef5e6193 (diff)
downloadgsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.tar
gsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.tar.gz
gsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.tar.bz2
gsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.tar.lz
gsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.tar.xz
gsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.tar.zst
gsoc2013-evolution-aaa9b9bb2ab4ff9fba2a6b9cc68fbc7fdfaa71bc.zip
Use e_utf8_to_gtk_string() on the description of the attachment since
2001-05-28 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment-bar.c (update): Use e_utf8_to_gtk_string() on the description of the attachment since camel stores these as utf-8 strings. svn path=/trunk/; revision=10036
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer-attachment-bar.c31
2 files changed, 24 insertions, 13 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index a3f7f8933b..e771a2e03a 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2001-05-28 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer-attachment-bar.c (update): Use
+ e_utf8_to_gtk_string() on the description of the attachment since
+ camel stores these as utf-8 strings.
+
2001-05-28 Jason Leach <jleach@ximian.com>
* Makefile.am (INCLUDES): srcdir != builddir fix.
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index 10d711a384..b039a1f7a8 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -44,6 +44,8 @@
#include "e-icon-list.h"
+#include <gal/widgets/e-unicode.h>
+
#include "camel/camel-data-wrapper.h"
#include "camel/camel-stream-fs.h"
#include "camel/camel-stream-mem.h"
@@ -242,11 +244,11 @@ update (EMsgComposerAttachmentBar *bar)
/* FIXME could be faster, but we don't care. */
for (p = priv->attachments; p != NULL; p = p->next) {
EMsgComposerAttachment *attachment;
- const gchar *desc;
gchar *size_string, *label;
CamelContentType *content_type;
GdkPixbuf *pixbuf;
gboolean image;
+ char *desc;
attachment = p->data;
content_type = camel_mime_part_get_content_type (attachment->body);
@@ -261,14 +263,14 @@ update (EMsgComposerAttachmentBar *bar)
gboolean error = TRUE;
char tmp[4096];
int t;
-
+
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body));
mstream = camel_stream_mem_new ();
-
+
camel_data_wrapper_write_to_stream (wrapper, mstream);
-
+
camel_stream_reset (mstream);
-
+
/* Stream image into pixbuf loader */
loader = gdk_pixbuf_loader_new ();
do {
@@ -287,7 +289,7 @@ update (EMsgComposerAttachmentBar *bar)
}
} while (!camel_stream_eos (mstream));
-
+
if (!error) {
int ratio, width, height;
@@ -318,18 +320,20 @@ update (EMsgComposerAttachmentBar *bar)
g_warning ("GdkPixbufLoader Error");
image = FALSE;
}
-
+
/* Destroy everything */
gdk_pixbuf_loader_close (loader);
gtk_object_destroy (GTK_OBJECT (loader));
camel_stream_close (mstream);
}
- desc = camel_mime_part_get_description (attachment->body);
+ desc = e_utf8_to_gtk_string (GTK_WIDGET (icon_list), camel_mime_part_get_description (attachment->body));
if (!desc || *desc == '\0')
- desc = camel_mime_part_get_filename (attachment->body);
+ desc = e_utf8_to_gtk_string (GTK_WIDGET (icon_list),
+ camel_mime_part_get_filename (attachment->body));
+
if (!desc)
- desc = _("attachment");
+ desc = g_strdup (_("attachment"));
if (attachment->size) {
size_string = size_to_string (attachment->size);
@@ -337,12 +341,12 @@ update (EMsgComposerAttachmentBar *bar)
g_free (size_string);
} else
label = g_strdup (desc);
-
+
if (image) {
e_icon_list_append_pixbuf (icon_list, attachment->pixbuf_cache, NULL, label);
} else {
char *mime_type;
-
+
mime_type = header_content_type_simple (content_type);
pixbuf = pixbuf_for_mime_type (mime_type);
g_free (mime_type);
@@ -351,7 +355,8 @@ update (EMsgComposerAttachmentBar *bar)
if (pixbuf)
gdk_pixbuf_unref (pixbuf);
}
-
+
+ g_free (desc);
g_free (label);
}