aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-spell.c
diff options
context:
space:
mode:
authorVitaly Minko <vitaly.mink@gmail.com>2010-10-22 20:08:22 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-22 20:08:22 +0800
commitd2f7a29078e2b351e1c52cc6db049808ae86ae1f (patch)
tree400c7c9f5fcb693bc2d56af829f9741550b6dcaa /libempathy-gtk/empathy-spell.c
parent3c83182d654711d5f86b30ed8b7d3bf9af418d94 (diff)
downloadgsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.tar
gsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.tar.gz
gsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.tar.bz2
gsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.tar.lz
gsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.tar.xz
gsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.tar.zst
gsoc2013-empathy-d2f7a29078e2b351e1c52cc6db049808ae86ae1f.zip
add a new popup-menu item in the chat window allowing to add words to dictionaries (#550775).
Diffstat (limited to 'libempathy-gtk/empathy-spell.c')
-rw-r--r--libempathy-gtk/empathy-spell.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-spell.c b/libempathy-gtk/empathy-spell.c
index b9abcd5f7..dcbbaf8cd 100644
--- a/libempathy-gtk/empathy-spell.c
+++ b/libempathy-gtk/empathy-spell.c
@@ -359,7 +359,8 @@ empathy_spell_check (const gchar *word)
}
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;
@@ -409,6 +410,26 @@ empathy_spell_supported (void)
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
@@ -454,6 +475,14 @@ empathy_spell_free_language_codes (GList *codes)
{
}
+void
+empathy_spell_add_to_dictionary (const gchar *code,
+ const gchar *word)
+{
+ DEBUG ("Support disabled, could not expand the dictionary");
+}
+
+
#endif /* HAVE_ENCHANT */