aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-attachment-bar.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-16 02:55:33 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-16 02:55:33 +0800
commitf57b228500d5511f3985c6986a26d2aaa732d42c (patch)
treecedf9cbca4252083794fc7c55666cc2a38431386 /composer/e-msg-composer-attachment-bar.c
parent6313647810adb53640b429819dbd50a98aa78fe2 (diff)
downloadgsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.tar
gsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.tar.gz
gsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.tar.bz2
gsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.tar.lz
gsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.tar.xz
gsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.tar.zst
gsoc2013-evolution-f57b228500d5511f3985c6986a26d2aaa732d42c.zip
Same idea here as with build_mesage(), don't convert th gconf charset
2004-04-15 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment-bar.c (attach_to_multipart): Same idea here as with build_mesage(), don't convert th gconf charset setting to the iconv name before setting it on the mime part. * e-msg-composer.c (best_charset): Now returns a malloc'd string bufefr containing the charset that has NOT been converted to the iconv name. This is important in order to avoid using the iconv charset name which may or may not necessarily be the IANA blessed name. (composer_get_default_charset_setting): Changed to always return the actual value in the settings (eg. don't return the iconv name). (build_message): Updated for changes to best_charset(). Set the actual charset name as the charset param and then get the iconv_charset from that. Use iconv_charset everywhere else. (get_file_content): Updated for changes to get_default_charset_setting(). (setup_ui): Same. svn path=/trunk/; revision=25487
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r--composer/e-msg-composer-attachment-bar.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index 5f035ec410..d2f0ff4d48 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -743,29 +743,31 @@ e_msg_composer_attachment_bar_new (GtkAdjustment *adj)
return GTK_WIDGET (new);
}
-static const char *
+static char *
get_default_charset (void)
{
GConfClient *gconf;
- const char *charset;
- char *buf;
+ const char *locale;
+ char *charset;
gconf = gconf_client_get_default ();
- buf = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
- if (buf && buf[0] == '\0') {
- g_free (buf);
- buf = NULL;
+ charset = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
+
+ if (!charset || charset[0] == '\0') {
+ g_free (charset);
+ charset = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
+ if (charset && charset[0] == '\0') {
+ g_free (charset);
+ charset = NULL;
+ }
}
g_object_unref (gconf);
- if (buf != NULL) {
- charset = e_iconv_charset_name (buf);
- g_free (buf);
- } else
- charset = e_iconv_locale_charset ();
+ if (!charset && (locale = e_iconv_locale_charset ()))
+ charset = g_strdup (locale);
- return charset;
+ return charset ? charset : g_strdup ("us-ascii");
}
static void
@@ -786,6 +788,7 @@ attach_to_multipart (CamelMultipart *multipart,
CamelMimeFilterBestenc *bestenc;
CamelStream *stream;
const char *charset;
+ char *buf = NULL;
char *type;
charset = camel_content_type_param (content_type, "charset");
@@ -808,7 +811,7 @@ attach_to_multipart (CamelMultipart *multipart,
default_charset = "us-ascii";
} else if (!charset) {
if (!default_charset)
- default_charset = get_default_charset ();
+ default_charset = buf = get_default_charset ();
/* FIXME: We should really check that this fits within the
default_charset and if not find one that does and/or
@@ -821,6 +824,7 @@ attach_to_multipart (CamelMultipart *multipart,
type = camel_content_type_format (content_type);
camel_mime_part_set_content_type (attachment->body, type);
g_free (type);
+ g_free (buf);
}
camel_object_unref (bestenc);