[evolution/wip/webkit-composer: 183/372] Remove e_spell_dictionary_free_suggestions().



commit 1a8c4033ae8fafdf7d48e01158c1ae9e08e034a6
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jan 18 12:37:32 2013 -0500

    Remove e_spell_dictionary_free_suggestions().
    
    Use g_list_free_full() instead.

 .../evolution-util/evolution-util-sections.txt     |    1 -
 e-util/e-editor-spell-check-dialog.c               |    2 +-
 e-util/e-editor.c                                  |    2 +-
 e-util/e-spell-checker.c                           |    2 +-
 e-util/e-spell-dictionary.c                        |   24 +++++++------------
 e-util/e-spell-dictionary.h                        |    2 -
 6 files changed, 12 insertions(+), 21 deletions(-)
---
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt 
b/doc/reference/evolution-util/evolution-util-sections.txt
index 4b5e810..b0c2414 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3945,7 +3945,6 @@ e_spell_dictionary_check
 e_spell_dictionary_learn_word
 e_spell_dictionary_ignore_word
 e_spell_dictionary_get_suggestions
-e_spell_dictionary_free_suggestions
 e_spell_dictionary_store_correction
 e_spell_dictionary_get_parent_checker
 <SUBSECTION Standard>
diff --git a/e-util/e-editor-spell-check-dialog.c b/e-util/e-editor-spell-check-dialog.c
index 1b102f7..64b5cd1 100644
--- a/e-util/e-editor-spell-check-dialog.c
+++ b/e-util/e-editor-spell-check-dialog.c
@@ -103,7 +103,7 @@ editor_spell_check_dialog_set_word (EEditorSpellCheckDialog *dialog,
                gtk_list_store_set (store, &iter, 0, suggestion, -1);
        }
 
-       e_spell_dictionary_free_suggestions (list);
+       g_list_free_full (list, (GDestroyNotify) g_free);
 
        /* We give focus to WebKit so that the currently selected word
         * is highlited. Without focus selection is not visible (at
diff --git a/e-util/e-editor.c b/e-util/e-editor.c
index a4cfae6..f657a8b 100644
--- a/e-util/e-editor.c
+++ b/e-util/e-editor.c
@@ -273,7 +273,7 @@ editor_spell_checkers_foreach (ESpellDictionary *dictionary,
                g_free (action_label);
        }
 
-       e_spell_dictionary_free_suggestions (list);
+       g_list_free_full (list, (GDestroyNotify) g_free);
 
        g_free (path);
        g_free (word);
diff --git a/e-util/e-spell-checker.c b/e-util/e-spell-checker.c
index b14504b..306b0eb 100644
--- a/e-util/e-spell-checker.c
+++ b/e-util/e-spell-checker.c
@@ -174,7 +174,7 @@ wksc_get_guesses (WebKitSpellChecker *webkit_checker,
 
                        guesses[ii] = 0;
 
-                       e_spell_dictionary_free_suggestions (suggestions);
+                       g_list_free_full (suggestions, (GDestroyNotify) g_free);
                }
        }
 
diff --git a/e-util/e-spell-dictionary.c b/e-util/e-spell-dictionary.c
index e2c7000..5857250 100644
--- a/e-util/e-spell-dictionary.c
+++ b/e-util/e-spell-dictionary.c
@@ -663,8 +663,15 @@ e_spell_dictionary_ignore_word (ESpellDictionary *dictionary,
  *
  * Provides list of alternative spellings of @word.
  *
- * Returns: a list of strings that has to be free'd by
- * e_spell_dictionary_free_suggestions().
+ * Free the returned spelling suggestions with g_free(), and the list
+ * itself with g_list_free().  An easy way to free the list properly in
+ * one step is as follows:
+ *
+ * |[
+ *   g_list_free_full (list, (GDestroyNotify) g_free);
+ * ]|
+ *
+ * Returns: a list of spelling suggestions for @word
  */
 GList *
 e_spell_dictionary_get_suggestions (ESpellDictionary *dictionary,
@@ -689,19 +696,6 @@ e_spell_dictionary_get_suggestions (ESpellDictionary *dictionary,
 }
 
 /**
- * e_spell_dictionary_free_suggestions:
- * @suggestions: (allow-none) a list of suggestions obtained from
- *              e_spell_dictionary_get_suggestions()
- *
- * Frees the @suggestions list.
- */
-void
-e_spell_dictionary_free_suggestions (GList *suggestions)
-{
-       g_list_foreach (suggestions, (GFunc) g_free, NULL);
-}
-
-/**
  * e_spell_dictionary_add_correction
  * @dictionary: an #ESpellDictionary
  * @misspelled: a misspelled word
diff --git a/e-util/e-spell-dictionary.h b/e-util/e-spell-dictionary.h
index caf4b87..b25896c 100644
--- a/e-util/e-spell-dictionary.h
+++ b/e-util/e-spell-dictionary.h
@@ -85,8 +85,6 @@ GList *               e_spell_dictionary_get_suggestions
                                                (ESpellDictionary *dictionary,
                                                 const gchar *word,
                                                 gsize length);
-void           e_spell_dictionary_free_suggestions
-                                               (GList *suggestions);
 void           e_spell_dictionary_store_correction
                                                (ESpellDictionary *dictionary,
                                                 const gchar *misspelled,


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