[evolution/wip/webkit-composer: 181/372] Add e_spell_dictionary_equal().



commit 9a55b5b7b6ea7c598f48e630f67f2857932fa8e9
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.

 .../evolution-util/evolution-util-sections.txt     |    1 +
 e-util/e-spell-dictionary.c                        |   28 ++++++++++++++++++++
 e-util/e-spell-dictionary.h                        |    2 +
 3 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt 
b/doc/reference/evolution-util/evolution-util-sections.txt
index 5aa561b..47f1be0 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3937,6 +3937,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]