diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 20 | ||||
-rw-r--r-- | src/compose.h | 7 |
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; |