[gspell] language: return GList for get_available()



commit 4a625f69389d24340c2032fd2af890bee65dbac7
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Dec 10 17:38:30 2015 +0100

    language: return GList for get_available()
    
    A GList is more convenient than GSList, and GtkHtml uses a GList. It's
    planned to replace the GspellLanguage code by the GtkHtml
    implementation, so as a first step reduce the delta between the two
    headers.

 gspell/gspell-checker.c                 |    2 +-
 gspell/gspell-language-chooser-dialog.c |    4 ++--
 gspell/gspell-language.c                |   14 +++++++-------
 gspell/gspell-language.h                |    3 +--
 4 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/gspell/gspell-checker.c b/gspell/gspell-checker.c
index 3ade6f4..cdb9605 100644
--- a/gspell/gspell-checker.c
+++ b/gspell/gspell-checker.c
@@ -277,7 +277,7 @@ get_default_language (void)
 {
        const GspellLanguage *lang;
        const gchar * const *lang_names;
-       const GSList *langs;
+       const GList *langs;
        gint i;
 
        /* Try with the current locale */
diff --git a/gspell/gspell-language-chooser-dialog.c b/gspell/gspell-language-chooser-dialog.c
index 4c1fb70..34f20a1 100644
--- a/gspell/gspell-language-chooser-dialog.c
+++ b/gspell/gspell-language-chooser-dialog.c
@@ -304,8 +304,8 @@ populate_language_list (GspellLanguageChooserDialog *dialog)
 {
        GspellLanguageChooserDialogPrivate *priv;
        GtkListStore *store;
-       const GSList *available_langs;
-       const GSList *l;
+       const GList *available_langs;
+       const GList *l;
 
        priv = gspell_language_chooser_dialog_get_instance_private (dialog);
 
diff --git a/gspell/gspell-language.c b/gspell/gspell-language.c
index 2b87adf..96c31b2 100644
--- a/gspell/gspell-language.c
+++ b/gspell/gspell-language.c
@@ -47,7 +47,7 @@ G_DEFINE_BOXED_TYPE (GspellLanguage,
                     gspell_language_free)
 
 static gboolean available_languages_initialized = FALSE;
-static GSList *available_languages = NULL;
+static GList *available_languages = NULL;
 
 static GHashTable *iso_639_table = NULL;
 static GHashTable *iso_3166_table = NULL;
@@ -421,9 +421,9 @@ build_langs_list (const gchar *key,
        lang->abrev = g_strdup (key);
        lang->name = g_strdup (value);
 
-       available_languages = g_slist_insert_sorted (available_languages,
-                                                    lang,
-                                                    (GCompareFunc)lang_cmp);
+       available_languages = g_list_insert_sorted (available_languages,
+                                                   lang,
+                                                   (GCompareFunc)lang_cmp);
 
        return FALSE;
 }
@@ -434,7 +434,7 @@ build_langs_list (const gchar *key,
  * Returns: (transfer none) (element-type GspellLanguage): the list of available
  * languages for the spell checking.
  */
-const GSList *
+const GList *
 gspell_language_get_available (void)
 {
        EnchantBroker *broker;
@@ -499,7 +499,7 @@ gspell_language_get_code (const GspellLanguage *lang)
 const GspellLanguage *
 gspell_language_lookup (const gchar *key)
 {
-       const GSList *langs;
+       const GList *langs;
 
        g_return_val_if_fail (key != NULL, NULL);
 
@@ -512,7 +512,7 @@ gspell_language_lookup (const gchar *key)
                if (g_ascii_strcasecmp (key, l->abrev) == 0)
                        return l;
 
-               langs = g_slist_next (langs);
+               langs = langs->next;
        }
 
        return NULL;
diff --git a/gspell/gspell-language.h b/gspell/gspell-language.h
index f509936..1dccc30 100644
--- a/gspell/gspell-language.h
+++ b/gspell/gspell-language.h
@@ -35,8 +35,7 @@ typedef struct _GspellLanguage GspellLanguage;
 
 GType          gspell_language_get_type                (void) G_GNUC_CONST;
 
-/* GSList contains "GspellLanguage*" items */
-const GSList * gspell_language_get_available           (void);
+const GList *  gspell_language_get_available           (void);
 
 const GspellLanguage *
                gspell_language_lookup                  (const gchar *key);


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