[evolution/webkit-composer: 121/181] Remove e_spell_dictionary_free_suggestions().



commit 2a6cf102cec9492166cff54a41d7b1d1f266bd60
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 bf89bab..adb3abe 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3682,7 +3682,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,
diff --git a/e-util/e-spell-entry.c b/e-util/e-spell-entry.c
index ee5073f..d99359b 100644
--- a/e-util/e-spell-entry.c
+++ b/e-util/e-spell-entry.c
@@ -411,7 +411,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]