--- a/ChangeLog Sat May 17 17:52:16 2008 -0400
+++ b/ChangeLog Sat May 17 17:57:09 2008 -0400
@@ -7,6 +7,8 @@
* Added google plugin for "I'm Feeling Lucky" searches.
* Fixed aspell dependency in switchspell (fixes gentoo bug #196693)
* Added nodashi's manualsize plugin
+ * Made switchspell work with gtkspell that uses enchant using + --enable-enchant option to ./configure * Fixed a typo in irc-more's source that allowed a potential double-free
--- a/configure.ac Sat May 17 17:52:16 2008 -0400
+++ b/configure.ac Sat May 17 17:57:09 2008 -0400
@@ -268,6 +268,18 @@
AC_CHECK_LIB([aspell], [new_aspell_config], ASPELL_LIBS="-laspell", BUILD_SWITCH_SPELL=no)
+AC_ARG_ENABLE(enchant, [AC_HELP_STRING([--enable-enchant], [compile with gtkspell using enchant])], + enable_enchant="$enableval", enable_enchant="no") +if test "x$enable_enchant" = "xyes"; then + PKG_CHECK_MODULES(ENCHANT, enchant, [ + ASPELL_LIBS=""], [gtkspell=no]) + ENCHANT_CFLAGS="-DUSE_ENCHANT $ENCHANT_CFLAGS" + AC_SUBST(ENCHANT_CFLAGS) --- a/switchspell/Makefile.am Sat May 17 17:52:16 2008 -0400
+++ b/switchspell/Makefile.am Sat May 17 17:57:09 2008 -0400
@@ -16,6 +16,7 @@
switchspell_la_LIBADD = \
@@ -27,6 +28,7 @@
-DDATADIR=\"$(PIDGIN_DATADIR)\" \
-DPIXMAPSDIR=\"$(PIDGIN_PIXMAPSDIR)\" \
--- a/switchspell/switchspell.c Sat May 17 17:52:16 2008 -0400
+++ b/switchspell/switchspell.c Sat May 17 17:57:09 2008 -0400
@@ -35,7 +35,11 @@
#include <gtkspell/gtkspell.h>
@@ -81,8 +85,12 @@
gtkconv = PIDGIN_CONVERSATION(conv);
spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(gtkconv->entry));
- gtkspell_set_language(spell, lang, &error); /* XXX: error can possibly leak here */
+ if (!gtkspell_set_language(spell, lang, &error)) { + purple_debug_error("switchspell", "failed to set language %s: %s\n", lang, error->message); g_object_set_data(G_OBJECT(gtkconv->entry), PROP_LANG, lang);
node = blist_node_for_conv(gtkconv->active_conv);
@@ -97,10 +105,14 @@
AspellDictInfoList * dlist;
AspellDictInfoEnumeration * dels;
const AspellDictInfo * entry;
@@ -122,6 +134,13 @@
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mitem), menu);
+ void enchant_dict_desc_cb(const char * const lang_tag, const char * const provider_name, + const char * const provider_desc, const char * const provider_file, + GtkWidget *menuitem = gtk_radio_menu_item_new_with_label(group, lang_tag); config = new_aspell_config();
dlist = get_aspell_dict_info_list(config);
delete_aspell_config(config);
@@ -130,16 +149,27 @@
aspell_dict_info_list_empty(dlist);
while ((entry = aspell_dict_info_enumeration_next(dels)) != 0) {
GtkWidget *menuitem = gtk_radio_menu_item_new_with_label(group, entry->name);
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(menuitem));
g_object_set_data(G_OBJECT(menuitem), "user_data", win);
+ g_object_set_data_full(G_OBJECT(menuitem), "lang", g_strdup(lang_tag), g_free); g_object_set_data(G_OBJECT(menuitem), "lang", (gchar *)entry->name);
g_signal_connect(G_OBJECT(menuitem), "activate",
G_CALLBACK(menu_conv_use_dict_cb), NULL);
gtk_widget_show(menuitem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+ eb = enchant_broker_init(); + enchant_broker_list_dicts(eb, enchant_dict_desc_cb, NULL); + enchant_broker_free(eb); delete_aspell_dict_info_enumeration(dels);
gtk_widget_show_all(menu);