[evolution/webkit-composer: 119/130] Remove e_spell_dictionary_free_suggestions().



commit 6b735240f44f0686dd459a5dc930abf95ccdfbed
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.

 doc/reference/libeutil/libeutil-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 --
 e-util/e-spell-entry.c                       |    2 +-
 7 files changed, 13 insertions(+), 22 deletions(-)
---
diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 5cca6f4..d7d4522 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3691,7 +3691,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 231944e..e2f1aa7 100644
--- a/e-util/e-editor.c
+++ b/e-util/e-editor.c
@@ -276,7 +276,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 eb3d39d..d0fb4fd 100644
--- a/e-util/e-spell-dictionary.c
+++ b/e-util/e-spell-dictionary.c
@@ -662,8 +662,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,
@@ -688,19 +695,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 word to which add a correction
diff --git a/e-util/e-spell-dictionary.h b/e-util/e-spell-dictionary.h
index 7d92a56..55703e9 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 len);
-void		e_spell_dictionary_free_suggestions
-						(GList *suggestions);
 void		e_spell_dictionary_store_correction
 						(ESpellDictionary *dictionary,
 						 const gchar *misspelled,
diff --git a/e-util/e-spell-entry.c b/e-util/e-spell-entry.c
index 09690f0..c4ea294 100644
--- a/e-util/e-spell-entry.c
+++ b/e-util/e-spell-entry.c
@@ -391,7 +391,7 @@ build_suggestion_menu (ESpellEntry *entry,
 		}
 	}
 
-	e_spell_dictionary_free_suggestions (suggestions);
+	g_list_free_full (suggestions, (GDestroyNotify) g_free);
 }
 
 static GtkWidget *



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