aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-composer-prefs.c
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2002-05-24 03:28:06 +0800
committerRadek Doulik <rodo@src.gnome.org>2002-05-24 03:28:06 +0800
commit3f4937a50cdd2cc87f2103b1b5e47525af4028e6 (patch)
tree529fa7a2ae8b374cc6b16d93c0c94b529603960c /mail/mail-composer-prefs.c
parentb3029f0665371922680519b561e03b54014dc146 (diff)
downloadgsoc2013-evolution-3f4937a50cdd2cc87f2103b1b5e47525af4028e6.tar.gz
gsoc2013-evolution-3f4937a50cdd2cc87f2103b1b5e47525af4028e6.tar.zst
gsoc2013-evolution-3f4937a50cdd2cc87f2103b1b5e47525af4028e6.zip
be more careful about language_str{_orig}
2002-05-23 Radek Doulik <rodo@ximian.com> * mail-composer-prefs.c: be more careful about language_str{_orig} svn path=/trunk/; revision=16987
Diffstat (limited to 'mail/mail-composer-prefs.c')
-rw-r--r--mail/mail-composer-prefs.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index 15f87826c6..29f0802b42 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -566,7 +566,7 @@ spell_get_language_str (MailComposerPrefs *prefs)
rv = str->str;
g_string_free (str, FALSE);
- return rv;
+ return rv ? rv : g_strdup ("");
}
static void
@@ -589,7 +589,7 @@ static void
spell_save_orig (MailComposerPrefs *prefs)
{
g_free (prefs->language_str_orig);
- prefs->language_str_orig = g_strdup (prefs->language_str);
+ prefs->language_str_orig = g_strdup (prefs->language_str ? prefs->language_str : "");
prefs->spell_error_color_orig = prefs->spell_error_color;
}
@@ -605,9 +605,11 @@ static void
spell_load_values (MailComposerPrefs *prefs)
{
GConfValue *val;
+ gchar *def_lang;
+ def_lang = g_strdup (_("en"));
g_free (prefs->language_str);
- prefs->language_str = g_strdup (_("en"));
+ prefs->language_str = g_strdup (def_lang);
prefs->spell_error_color.red = 0xffff;
prefs->spell_error_color.green = 0;
prefs->spell_error_color.blue = 0;
@@ -617,7 +619,12 @@ spell_load_values (MailComposerPrefs *prefs)
GET (int, "/spell_error_color_blue", prefs->spell_error_color.blue,,);
GET (string, "/language", prefs->language_str, g_free (prefs->language_str), g_strdup);
+ if (prefs->language_str == NULL)
+ prefs->language_str = g_strdup (def_lang);
+
spell_save_orig (prefs);
+
+ g_free (def_lang);
}
#define SET(t,x,prop) \
@@ -633,8 +640,9 @@ spell_save_values (MailComposerPrefs *prefs, gboolean force)
SET (int, "/spell_error_color_green", prefs->spell_error_color.green);
SET (int, "/spell_error_color_blue", prefs->spell_error_color.blue);
}
+
if (force || !STR_EQUAL (prefs->language_str, prefs->language_str_orig)) {
- SET (string, "/language", prefs->language_str);
+ SET (string, "/language", prefs->language_str ? prefs->language_str : "");
}
gconf_client_suggest_sync (prefs->gconf, NULL);