[evolution-patches] fix for empty charset names in Content-Type header




-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? 47638.patch
? composer.patch
? msg-composer.c
? select-file.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.544.2.15
diff -u -r1.544.2.15 ChangeLog
--- ChangeLog	23 Sep 2003 08:35:32 -0000	1.544.2.15
+++ ChangeLog	26 Sep 2003 19:33:58 -0000
@@ -1,3 +1,12 @@
+2003-09-24  Jeffrey Stedfast  <fejj ximian com>
+
+	* e-msg-composer-attachment-bar.c (get_default_charset): Same as
+	below.
+
+	* e-msg-composer.c (composer_get_default_charset_setting): Handle
+	empty-string as the charset value gotten from gconf as this can
+	happen. Partial fix for bug #47638.
+
 2003-09-23  Charles Zhang  <charles zhang sun com>
  
 	* e-msg-composer-attachment-bar.c (remove_attachment): Add some
Index: e-msg-composer-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.67.4.5
diff -u -r1.67.4.5 e-msg-composer-attachment-bar.c
--- e-msg-composer-attachment-bar.c	23 Sep 2003 08:35:32 -0000	1.67.4.5
+++ e-msg-composer-attachment-bar.c	26 Sep 2003 19:33:59 -0000
@@ -735,6 +735,11 @@
 	
 	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;
+	}
+	
 	g_object_unref (gconf);
 	
 	if (buf != NULL) {
Index: e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.395.2.7
diff -u -r1.395.2.7 e-msg-composer.c
--- e-msg-composer.c	29 Aug 2003 05:57:25 -0000	1.395.2.7
+++ e-msg-composer.c	26 Sep 2003 19:33:59 -0000
@@ -242,8 +242,14 @@
 	gconf = gconf_client_get_default ();
 	buf = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
 	
-	if (buf == NULL)
+	if (buf == NULL || buf[0] == '\0') {
+		g_free (buf);
 		buf = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
+		if (buf && buf[0] == '\0') {
+			g_free (buf);
+			buf = NULL;
+		}
+	}
 	
 	g_object_unref (gconf);
 	
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2761.2.26
diff -u -r1.2761.2.26 ChangeLog
--- ChangeLog	25 Sep 2003 16:09:12 -0000	1.2761.2.26
+++ ChangeLog	26 Sep 2003 19:38:59 -0000
@@ -1,3 +1,12 @@
+2003-09-24  Jeffrey Stedfast  <fejj ximian com>
+
+	* mail-preferences.c (mail_preferences_construct): Same as below.
+
+	* mail-composer-prefs.c (mail_composer_prefs_construct): gconf can
+	return empty string if the charset has not been set, so if the
+	charset string is empty, default the charset to the user's locale
+	charset. Partial fix for bug #47638.
+
 2003-09-25  Rodney Dawes  <dobey ximian com>
 
 	* mail-send-recv.c: Make the dialog more HIG-compliant by fixing
Index: mail-preferences.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-preferences.c,v
retrieving revision 1.32
diff -u -r1.32 mail-preferences.c
--- mail-preferences.c	11 Jun 2003 16:19:36 -0000	1.32
+++ mail-preferences.c	26 Sep 2003 19:38:59 -0000
@@ -240,7 +240,7 @@
 	
 	prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset"));
 	buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/format/charset", NULL);
-	menu = e_charset_picker_new (buf ? buf : e_iconv_locale_charset ());
+	menu = e_charset_picker_new (buf && *buf ? buf : e_iconv_locale_charset ());
 	gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu));
 	option_menu_connect (prefs->charset, prefs);
 	g_free (buf);
Index: mail-composer-prefs.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-composer-prefs.c,v
retrieving revision 1.66
diff -u -r1.66 mail-composer-prefs.c
--- mail-composer-prefs.c	25 Jun 2003 16:20:38 -0000	1.66
+++ mail-composer-prefs.c	26 Sep 2003 19:38:59 -0000
@@ -841,7 +841,7 @@
 
 	prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset"));
 	buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/composer/charset", NULL);
-	menu = e_charset_picker_new (buf ? buf : e_iconv_locale_charset ());
+	menu = e_charset_picker_new (buf && *buf ? buf : e_iconv_locale_charset ());
 	gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu));
 	option_menu_connect (prefs->charset, prefs);
 	g_free (buf);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]