[evolution/webkit-composer: 117/130] Add e_spell_dictionary_equal().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit-composer: 117/130] Add e_spell_dictionary_equal().
- Date: Sat, 19 Jan 2013 14:36:56 +0000 (UTC)
commit be384250bd6e1a31a35e3e96d80f79c6af32e772
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(+), 0 deletions(-)
---
diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 8924d90..0d1fb51 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3683,6 +3683,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 a5d3e37..a629bbd 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 141637d..e8c467a 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]