[gnome-control-center] Drop the sync language loading code
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Drop the sync language loading code
- Date: Thu, 24 Feb 2011 04:43:48 +0000 (UTC)
commit 3be36e735b5b6ae6654d20326b22ab8fd3fd2494
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 23 23:43:16 2011 -0500
Drop the sync language loading code
All users have been ported to use the async variant.
panels/common/cc-common-language.c | 45 +---------------------------
panels/common/cc-common-language.h | 6 +--
panels/region/gnome-region-panel-lang.c | 2 +-
panels/user-accounts/um-language-dialog.c | 2 +-
4 files changed, 6 insertions(+), 49 deletions(-)
---
diff --git a/panels/common/cc-common-language.c b/panels/common/cc-common-language.c
index f15be60..aab5851 100644
--- a/panels/common/cc-common-language.c
+++ b/panels/common/cc-common-language.c
@@ -181,47 +181,6 @@ cc_common_language_has_font (const gchar *locale)
return is_displayable;
}
-void
-cc_common_language_add_available_languages (GtkListStore *store,
- GHashTable *user_langs)
-{
- char **languages;
- int i;
- char *name;
- char *language;
- GtkTreeIter iter;
-
- languages = gdm_get_all_language_names ();
-
- for (i = 0; languages[i] != NULL; i++) {
- name = gdm_normalize_language_name (languages[i]);
- if (g_hash_table_lookup (user_langs, name) != NULL) {
- g_free (name);
- continue;
- }
-
- if (!cc_common_language_has_font (languages[i])) {
- g_free (name);
- continue;
- }
-
- language = gdm_get_language_from_name (name, NULL);
- if (!language) {
- g_debug ("Ignoring '%s' as a locale, because we couldn't figure the language name", name);
- g_free (name);
- continue;
- }
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, LOCALE_COL, name, DISPLAY_LOCALE_COL, language, -1);
-
- g_free (name);
- g_free (language);
- }
-
- g_strfreev (languages);
-}
-
typedef struct
{
GtkListStore *store;
@@ -284,8 +243,8 @@ add_one_language (gpointer d)
}
guint
-cc_common_language_add_available_languages_async (GtkListStore *store,
- GHashTable *user_langs)
+cc_common_language_add_available_languages (GtkListStore *store,
+ GHashTable *user_langs)
{
AsyncLangData *data;
diff --git a/panels/common/cc-common-language.h b/panels/common/cc-common-language.h
index bc1caba..be64037 100644
--- a/panels/common/cc-common-language.h
+++ b/panels/common/cc-common-language.h
@@ -37,10 +37,8 @@ enum {
gboolean cc_common_language_get_iter_for_language (GtkTreeModel *model,
const gchar *lang,
GtkTreeIter *iter);
-void cc_common_language_add_available_languages (GtkListStore *store,
- GHashTable *user_langs);
-guint cc_common_language_add_available_languages_async (GtkListStore *store,
- GHashTable *user_langs);
+guint cc_common_language_add_available_languages (GtkListStore *store,
+ GHashTable *user_langs);
gboolean cc_common_language_has_font (const gchar *locale);
gchar *cc_common_language_get_current_language (void);
diff --git a/panels/region/gnome-region-panel-lang.c b/panels/region/gnome-region-panel-lang.c
index 6b31d52..d9cc060 100644
--- a/panels/region/gnome-region-panel-lang.c
+++ b/panels/region/gnome-region-panel-lang.c
@@ -235,7 +235,7 @@ finish_language_setup (gpointer user_data)
model = gtk_tree_view_get_model (GTK_TREE_VIEW (list));
user_langs = g_object_get_data (G_OBJECT (list), "user-langs");
- async_id = cc_common_language_add_available_languages_async (GTK_LIST_STORE (model), user_langs);
+ async_id = cc_common_language_add_available_languages (GTK_LIST_STORE (model), user_langs);
g_object_set_data_full (G_OBJECT (list), "language-async",
GUINT_TO_POINTER (async_id), remove_async);
diff --git a/panels/user-accounts/um-language-dialog.c b/panels/user-accounts/um-language-dialog.c
index 8e19a8f..4a427cc 100644
--- a/panels/user-accounts/um-language-dialog.c
+++ b/panels/user-accounts/um-language-dialog.c
@@ -217,7 +217,7 @@ finish_um_language_chooser (gpointer user_data)
model = gtk_tree_view_get_model (GTK_TREE_VIEW (list));
user_langs = g_object_get_data (G_OBJECT (chooser), "user-langs");
- async_id = cc_common_language_add_available_languages_async (GTK_LIST_STORE (model), user_langs);
+ async_id = cc_common_language_add_available_languages (GTK_LIST_STORE (model), user_langs);
g_object_set_data_full (G_OBJECT (chooser), "language-async", GUINT_TO_POINTER (async_id), remove_async);
parent = gtk_window_get_transient_for (GTK_WINDOW (chooser));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]