*/
#include "config.h"
-
-#include <string.h>
-#include <stdlib.h>
+#include "empathy-spell.h"
#include <glib/gi18n-lib.h>
#include <enchant.h>
#endif
-#include "empathy-spell.h"
+#include "empathy-gsettings.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
-#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-gsettings.h>
+#include "empathy-debug.h"
#ifdef HAVE_ENCHANT
/* We just reset the languages list. */
if (languages != NULL) {
- g_hash_table_destroy (languages);
+ g_hash_table_unref (languages);
languages = NULL;
}
}
return;
}
- *list = g_list_append (*list, g_strdup (lang));
+ *list = g_list_append (*list, lang);
}
GList *
}
GList *
-empathy_spell_get_suggestions (const gchar *code, const gchar *word)
+empathy_spell_get_suggestions (const gchar *code,
+ const gchar *word)
{
gint len;
GList *suggestion_list = NULL;
return TRUE;
}
+void
+empathy_spell_add_to_dictionary (const gchar *code,
+ const gchar *word)
+{
+ SpellLanguage *lang;
+
+ g_return_if_fail (code != NULL);
+ g_return_if_fail (word != NULL);
+
+ spell_setup_languages ();
+ if (languages == NULL)
+ return;
+
+ lang = g_hash_table_lookup (languages, code);
+ if (lang == NULL)
+ return;
+
+ enchant_dict_add_to_pwl (lang->speller, word, strlen (word));
+}
+
#else /* not HAVE_ENCHANT */
gboolean
}
GList *
-empathy_spell_get_suggestions (const gchar *word)
+empathy_spell_get_suggestions (const gchar *code,
+ const gchar *word)
{
DEBUG ("Support disabled, could not get suggestions");
{
}
+void
+empathy_spell_add_to_dictionary (const gchar *code,
+ const gchar *word)
+{
+ DEBUG ("Support disabled, could not expand the dictionary");
+}
+
+GList *
+empathy_spell_get_enabled_language_codes (void)
+{
+ DEBUG ("Support disabled, could not get enabled language codes");
+
+ return NULL;
+}
+
#endif /* HAVE_ENCHANT */