From 21fd865ec00f00fea2c8be5777348314176d1129 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 9 Apr 2003 06:06:45 +0000 Subject: Same as with attachment-bar's get_default_charset(). (setup_ui): Instead 2003-04-09 Jeffrey Stedfast * e-msg-composer.c (composer_get_default_charset_setting): Same as with attachment-bar's get_default_charset(). (setup_ui): Instead of pulling the default charset from gconf, call our helper function above. * e-msg-composer-attachment-bar.c (get_default_charset): If gconf returns a NULL string, default back to the locale charset. svn path=/trunk/; revision=20775 --- composer/ChangeLog | 10 ++++++++++ composer/e-msg-composer-attachment-bar.c | 8 ++++++-- composer/e-msg-composer.c | 9 ++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'composer') diff --git a/composer/ChangeLog b/composer/ChangeLog index 1c29ae0d26..fff458434e 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,13 @@ +2003-04-09 Jeffrey Stedfast + + * e-msg-composer.c (composer_get_default_charset_setting): Same as + with attachment-bar's get_default_charset(). + (setup_ui): Instead of pulling the default charset from gconf, + call our helper function above. + + * e-msg-composer-attachment-bar.c (get_default_charset): If gconf + returns a NULL string, default back to the locale charset. + 2003-04-08 Jeffrey Stedfast * e-msg-composer.c (map_default_cb): Added some debug printfs. diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 0f227b3a1c..14b1244ca3 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -725,8 +725,12 @@ get_default_charset (void) gconf = gconf_client_get_default (); buf = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL); - charset = e_iconv_charset_name (buf); - g_free (buf); + + if (buf != NULL) { + charset = e_iconv_charset_name (buf); + g_free (buf); + } else + charset = e_iconv_locale_name (); return charset; } diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index ccaf6849fb..9f79adb202 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -243,8 +243,11 @@ composer_get_default_charset_setting (void) if (buf == NULL) buf = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL); - charset = e_iconv_charset_name (buf); - g_free (buf); + if (buf != NULL) { + charset = e_iconv_charset_name (buf); + g_free (buf); + } else + charset = e_iconv_locale_name (); return charset ? charset : "us-ascii"; } @@ -2092,7 +2095,7 @@ setup_ui (EMsgComposer *composer) /* Populate the Charset Encoding menu and default it to whatever the user chose as his default charset in the mailer */ gconf = gconf_client_get_default (); - default_charset = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL); + default_charset = composer_get_default_charset (); e_charset_picker_bonobo_ui_populate (composer->uic, "/menu/Edit/EncodingPlaceholder", default_charset, menu_changed_charset_cb, -- cgit v1.2.3