]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-spell.c
Merge commit 'staz/dnd'
[empathy.git] / libempathy-gtk / empathy-spell.c
index 914c0c78dcd781fac1f480a13ce853776f8b6e31..17c7f100e303bff989e9c1e7338b22665107e00c 100644 (file)
@@ -14,8 +14,8 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
  *
  * Authors: Martyn Russell <martyn@imendio.com>
  *          Richard Hult <richard@imendio.com>
@@ -175,7 +175,7 @@ spell_notify_languages_cb (EmpathyConf  *conf,
 
                enchant_broker_free_dict (lang->config, lang->speller);
                enchant_broker_free (lang->config);
-               
+
                g_slice_free (SpellLanguage, lang);
        }
 
@@ -219,7 +219,12 @@ spell_setup_languages (void)
                        lang->config = enchant_broker_init ();
                        lang->speller = enchant_broker_request_dict (lang->config, strv[i]);
 
-                       languages = g_list_append (languages, lang);
+                       if (lang->speller == NULL) {
+                               DEBUG ("language '%s' has no valid dict", strv[i]);
+                       } else {
+                               languages = g_list_append (languages, lang);
+                       }
+
                        i++;
                }
 
@@ -309,7 +314,6 @@ empathy_spell_check (const gchar *word)
        spell_setup_languages ();
 
        if (!languages) {
-               DEBUG ("No languages to check against");
                return TRUE;
        }
 
@@ -363,7 +367,7 @@ empathy_spell_get_suggestions (const gchar *word)
 
                suggestions = enchant_dict_suggest (lang->speller, word, len,
                                                    &number_of_suggestions);
-               
+
                for (i = 0; i < number_of_suggestions; i++) {
                        suggestion_list = g_list_append (suggestion_list,
                                                         g_strdup (suggestions[i]));