diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-01-08 09:27:05 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-01-08 09:27:05 +0800 |
commit | a7c452fa5770e07e4a23024e23433dec4d7dd49b (patch) | |
tree | 4a0258ae99dbef0a64b4da8e4c719d20c8984cf5 /composer/e-msg-composer.c | |
parent | a1bdd2e52646327225a8550beb968a683f840c45 (diff) | |
download | gsoc2013-evolution-a7c452fa5770e07e4a23024e23433dec4d7dd49b.tar.gz gsoc2013-evolution-a7c452fa5770e07e4a23024e23433dec4d7dd49b.tar.zst gsoc2013-evolution-a7c452fa5770e07e4a23024e23433dec4d7dd49b.zip |
Convenience function. (get_file_content): Use the convenience function to
2003-01-07 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (composer_get_default_charset): Convenience
function.
(get_file_content): Use the convenience function to get the
default charset setting.
(best_charset): Same.
(e_msg_composer_new): Use gconf to get the send_html setting.
(e_msg_composer_new_post): Same.
svn path=/trunk/; revision=19269
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index f47f3ae08c..27015fe623 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -55,6 +55,9 @@ #include <gtk/gtkoptionmenu.h> +#include <gconf/gconf.h> +#include <gconf/gconf-client.h> + #include <libgnome/gnome-exec.h> #include <libgnomeui/gnome-uidefs.h> #include <libgnomeui/gnome-window-icon.h> @@ -72,6 +75,7 @@ #include <gal/widgets/e-gui-utils.h> #include <gal/widgets/e-scroll-frame.h> #include <gal/e-text/e-entry.h> +#include <gal/util/e-iconv.h> #include "widgets/misc/e-charset-picker.h" @@ -224,6 +228,21 @@ best_encoding (GByteArray *buf, const char *charset) } static const char * +composer_get_default_charset_setting (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 const char * best_charset (GByteArray *buf, const char *default_charset, CamelMimePartEncodingType *encoding) { const char *charset; @@ -240,7 +259,7 @@ best_charset (GByteArray *buf, const char *default_charset, CamelMimePartEncodin return charset; /* Now try the user's default charset from the mail config */ - charset = mail_config_get_default_charset (); + charset = composer_get_default_charset_setting (); *encoding = best_encoding (buf, charset); if (*encoding != -1) return charset; @@ -251,6 +270,7 @@ best_charset (GByteArray *buf, const char *default_charset, CamelMimePartEncodin *encoding = CAMEL_MIME_PART_ENCODING_7BIT; else *encoding = best_encoding (buf, charset); + return charset; } @@ -820,7 +840,7 @@ get_file_content (EMsgComposer *composer, const char *file_name, gboolean want_h filtered_stream = camel_stream_filter_new_with_stream (stream); camel_object_unref (stream); - charset = composer ? composer->charset : mail_config_get_default_charset (); + charset = composer ? composer->charset : composer_get_default_charset_setting (); charenc = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "utf-8"); camel_stream_filter_add (filtered_stream, charenc); camel_object_unref (charenc); @@ -2931,11 +2951,16 @@ set_editor_signature (EMsgComposer *composer) EMsgComposer * e_msg_composer_new (void) { + gboolean send_html; + GConfClient *gconf; EMsgComposer *new; + gconf = gconf_client_get_default (); + send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL); + new = create_composer (E_MSG_COMPOSER_VISIBLE_MASK_MAIL); if (new) { - e_msg_composer_set_send_html (new, mail_config_get_send_html ()); + e_msg_composer_set_send_html (new, send_html); set_editor_text (new, ""); set_editor_signature (new); } @@ -2954,11 +2979,16 @@ e_msg_composer_new (void) EMsgComposer * e_msg_composer_new_post (void) { + gboolean send_html; + GConfClient *gconf; EMsgComposer *new; + gconf = gconf_client_get_default (); + send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL); + new = create_composer (E_MSG_COMPOSER_VISIBLE_MASK_POST); if (new) { - e_msg_composer_set_send_html (new, mail_config_get_send_html ()); + e_msg_composer_set_send_html (new, send_html); set_editor_text (new, ""); set_editor_signature (new); } |