aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-07-16 02:44:46 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-07-16 02:44:46 +0000
commitfb9d5f30a5caaa8345d2235f43dabef7570ae551 (patch)
treed7d16ffe1169a197aefd428caaea46c9aa3e23d9 /src
parentb7e440df52f5e1a3c64964753abedfc1b029667d (diff)
fixed Enchant support.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2028 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c20
-rw-r--r--src/compose.h7
2 files changed, 15 insertions, 12 deletions
diff --git a/src/compose.c b/src/compose.c
index 43cf2ecc..746e9712 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -5300,6 +5300,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
compose->check_spell = prefs_common.check_spell;
compose->spell_lang = g_strdup(prefs_common.spell_lang);
compose->spell_menu = spell_menu;
+ compose->dict_list = NULL;
#endif /* USE_GTKSPELL */
compose->focused_editable = NULL;
@@ -5760,8 +5761,9 @@ static void compose_set_spell_lang_menu(Compose *compose)
for (cur = dict_list; cur != NULL; cur = cur->next) {
if (compose->spell_lang != NULL &&
- g_ascii_strcasecmp(compose->spell_lang, cur->data) == 0)
- lang_set = TRUE;
+ g_ascii_strcasecmp(compose->spell_lang,
+ (gchar *)cur->data) == 0)
+ lang_set = TRUE;
}
#else /* !USE_ENCHANT */
static void compose_set_spell_lang_menu(Compose *compose)
@@ -5780,7 +5782,7 @@ static void compose_set_spell_lang_menu(Compose *compose)
dels = aspell_dict_info_list_elements(dlist);
while ((entry = aspell_dict_info_enumeration_next(dels)) != 0) {
- dict_list = g_slist_append(dict_list, (gchar *)entry->name);
+ dict_list = g_slist_append(dict_list, g_strdup(entry->name));
if (compose->spell_lang != NULL &&
g_ascii_strcasecmp(compose->spell_lang, entry->name) == 0)
lang_set = TRUE;
@@ -5788,6 +5790,8 @@ static void compose_set_spell_lang_menu(Compose *compose)
delete_aspell_dict_info_enumeration(dels);
#endif /* USE_ENCHANT */
+ compose->dict_list = dict_list;
+
menu = gtk_menu_new();
for (cur = dict_list; cur != NULL; cur = cur->next) {
@@ -5815,11 +5819,6 @@ static void compose_set_spell_lang_menu(Compose *compose)
(GTK_CHECK_MENU_ITEM(item), TRUE);
}
-#if USE_ENCHANT
- slist_free_strings(dict_list);
-#endif
- g_slist_free(dict_list);
-
gtk_widget_show(menu);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(compose->spell_menu), menu);
}
@@ -5962,6 +5961,8 @@ static void compose_destroy(Compose *compose)
address_completion_end(compose->window);
#if USE_GTKSPELL
+ slist_free_strings(compose->dict_list);
+ g_slist_free(compose->dict_list);
g_free(compose->spell_lang);
#endif
@@ -7543,7 +7544,8 @@ static void compose_toggle_spell_cb(gpointer data, guint action,
GtkSpell *speller;
if (GTK_CHECK_MENU_ITEM(widget)->active) {
- debug_print("Spell checking enabled\n");
+ debug_print("Spell checking enabled: %s\n",
+ compose->spell_lang ? compose->spell_lang : "(none)");
speller = gtkspell_new_attach(GTK_TEXT_VIEW(compose->text),
compose->spell_lang, NULL);
compose->check_spell = TRUE;
diff --git a/src/compose.h b/src/compose.h
index fa37cf8f..c81b31a0 100644
--- a/src/compose.h
+++ b/src/compose.h
@@ -133,9 +133,10 @@ struct _Compose
GtkWidget *tmpl_menu;
#if USE_GTKSPELL
- GtkWidget *spell_menu;
- gchar *spell_lang;
- gboolean check_spell;
+ GtkWidget *spell_menu;
+ gchar *spell_lang;
+ gboolean check_spell;
+ GSList *dict_list;
#endif
ComposeMode mode;