From 235dc4e759f1781b34a985233c6b707613db41ad Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 8 Jan 2003 01:31:21 +0000 Subject: New convenience function. (attach_to_multipart): Use 2003-01-07 Jeffrey Stedfast * e-msg-composer-attachment-bar.c (get_default_charset): New convenience function. (attach_to_multipart): Use get_default_charset(). svn path=/trunk/; revision=19270 --- composer/ChangeLog | 4 ++++ composer/e-msg-composer-attachment-bar.c | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index a388660dab..e0a258ff47 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,5 +1,9 @@ 2003-01-07 Jeffrey Stedfast + * e-msg-composer-attachment-bar.c (get_default_charset): New + convenience function. + (attach_to_multipart): Use get_default_charset(). + * e-msg-composer.c (composer_get_default_charset): Convenience function. (get_file_content): Use the convenience function to get the diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index dbcf37dc33..13bd6cb495 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -28,6 +28,9 @@ #include #include +#include +#include +#include #include #include #include @@ -715,6 +718,21 @@ e_msg_composer_attachment_bar_new (GtkAdjustment *adj) return GTK_WIDGET (new); } +static const char * +get_default_charset (void) +{ + GConfClient *gconf; + const char *charset; + char *buf; + + gconf = gconf_client_get_default (); + buf = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL); + charset = e_iconv_charset_name (buf); + g_free (buf); + + return charset; +} + static void attach_to_multipart (CamelMultipart *multipart, EMsgComposerAttachment *attachment, @@ -762,7 +780,7 @@ attach_to_multipart (CamelMultipart *multipart, default_charset = "us-ascii"; } else if (!charset) { if (!default_charset) - default_charset = mail_config_get_default_charset (); + default_charset = get_default_charset (); /* FIXME: We should really check that this fits within the default_charset and if not find one that does and/or -- cgit v1.2.3