[evolution/webkit-composer: 119/185] Add e_spell_dictionary_equal().



commit ae0527d73f7ba3a98eadc2409c77841ca4e05b53
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jan 17 07:41:38 2013 -0500

    Add e_spell_dictionary_equal().
    
    Checks two ESpellDictionary instances for equality based on their ISO
    codes.

 doc/reference/libeutil/libeutil-sections.txt |  1 +
 e-util/e-spell-dictionary.c                  | 28 ++++++++++++++++++++++++++++
 e-util/e-spell-dictionary.h                  |  2 ++
 3 files changed, 31 insertions(+)
---
diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 3608099..e63e225 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3797,6 +3797,7 @@ ESpellCheckerPrivate
 ESpellDictionary
 e_spell_dictionary_new
 e_spell_dictionary_hash
+e_spell_dictionary_equal
 e_spell_dictionary_get_name
 e_spell_dictionary_get_code
 e_spell_dictionary_check
diff --git a/e-util/e-spell-dictionary.c b/e-util/e-spell-dictionary.c
index e098e98..fa53816 100644
--- a/e-util/e-spell-dictionary.c
+++ b/e-util/e-spell-dictionary.c
@@ -503,6 +503,34 @@ e_spell_dictionary_hash (ESpellDictionary *dictionary)
 }
 
 /**
+ * e_spell_dictionary_equal:
+ * @dictionary1: an #ESpellDictionary
+ * @dictionary2: another #ESpellDictionary
+ *
+ * Checks two #ESpellDictionary instances for equality based on their
+ * ISO codes.
+ *
+ * Returns: %TRUE if @dictionary1 and @dictionary2 are equal
+ **/
+gboolean
+e_spell_dictionary_equal (ESpellDictionary *dictionary1,
+                          ESpellDictionary *dictionary2)
+{
+       const gchar *code1, *code2;
+
+       g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary1), FALSE);
+       g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary2), FALSE);
+
+       if (dictionary1 == dictionary2)
+               return TRUE;
+
+       code1 = e_spell_dictionary_get_code (dictionary1);
+       code2 = e_spell_dictionary_get_code (dictionary2);
+
+       return g_str_equal (code1, code2);
+}
+
+/**
  * e_spell_dictionary_get_name:
  * @dictionary: an #ESpellDictionary
  *
diff --git a/e-util/e-spell-dictionary.h b/e-util/e-spell-dictionary.h
index c46f4a7..ec8bfff 100644
--- a/e-util/e-spell-dictionary.h
+++ b/e-util/e-spell-dictionary.h
@@ -66,6 +66,8 @@ ESpellDictionary *
                e_spell_dictionary_new          (ESpellChecker *parent_checker,
                                                 EnchantDict *enchant_dict);
 guint          e_spell_dictionary_hash         (ESpellDictionary *dictionary);
+gboolean       e_spell_dictionary_equal        (ESpellDictionary *dictionary1,
+                                                ESpellDictionary *dictionary2);
 const gchar *  e_spell_dictionary_get_name     (ESpellDictionary *dictionary);
 const gchar *  e_spell_dictionary_get_code     (ESpellDictionary *dictionary);
 gboolean       e_spell_dictionary_check        (ESpellDictionary *dictionary,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]