[gnome-control-center] Region: load languages async
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Region: load languages async
- Date: Thu, 24 Feb 2011 03:13:15 +0000 (UTC)
commit 3e25e3d2133a4d93d91a30ff35cdb01f026dc288
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 23 22:02:44 2011 -0500
Region: load languages async
https://bugzilla.gnome.org/show_bug.cgi?id=643096
panels/region/gnome-region-panel-lang.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-lang.c b/panels/region/gnome-region-panel-lang.c
index 6fa77c3..6b31d52 100644
--- a/panels/region/gnome-region-panel-lang.c
+++ b/panels/region/gnome-region-panel-lang.c
@@ -208,6 +208,15 @@ remove_timeout (gpointer data,
g_source_remove (timeout);
}
+static void
+remove_async (gpointer data)
+{
+ guint id = GPOINTER_TO_UINT (data);
+
+ /* if the idle is already done, this harmlessly fails */
+ g_source_remove (id);
+}
+
static gboolean
finish_language_setup (gpointer user_data)
{
@@ -217,6 +226,7 @@ finish_language_setup (gpointer user_data)
GHashTable *user_langs;
guint timeout;
GtkTreeSelection *selection;
+ guint async_id;
/* Did we get called after the widget was destroyed? */
if (list == NULL)
@@ -225,7 +235,10 @@ 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");
- cc_common_language_add_available_languages (GTK_LIST_STORE (model), user_langs);
+ async_id = cc_common_language_add_available_languages_async (GTK_LIST_STORE (model), user_langs);
+
+ g_object_set_data_full (G_OBJECT (list), "language-async",
+ GUINT_TO_POINTER (async_id), remove_async);
parent = gtk_widget_get_toplevel (list);
gdk_window_set_cursor (gtk_widget_get_window (parent), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]