+2007-04-11 Chris Wilson <chris@chris-wilson.co.uk>
+
+ * gtk/gtkiconfactory.c (_gtk_icon_factory_list_ids):
+ * gtk/gtkstock.c (gtk_stock_list_ids):
+ Switch over to use glib's new g_hash_table_get_keys() rather
+ than our own static implementation.
+
+ * gtk/gtkiconfactory.h: Update to return a GList.
+
+ * configure.in: Bump required version to 2.13.1
+
2007-04-11 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gdk/quartz/gdkeventloop-quartz.c: Protect the polling thread
m4_define([gtk_binary_version], [2.10.0])
# required versions of other packages
-m4_define([glib_required_version], [2.13.0])
+m4_define([glib_required_version], [2.13.1])
m4_define([pango_required_version], [1.15.3])
m4_define([atk_required_version], [1.9.0])
m4_define([cairo_required_version], [1.2.0])
++cache_serial;
}
-static void
-listify_foreach (gpointer key, gpointer value, gpointer data)
-{
- GSList **list = data;
-
- *list = g_slist_prepend (*list, key);
-}
-
-static GSList *
-g_hash_table_get_keys (GHashTable *table)
-{
- GSList *list = NULL;
-
- g_hash_table_foreach (table, listify_foreach, &list);
-
- return list;
-}
-
/**
* _gtk_icon_factory_list_ids:
*
*
* Return value: List of ids in icon factories
**/
-GSList*
+GList*
_gtk_icon_factory_list_ids (void)
{
GSList *tmp_list;
- GSList *ids;
+ GList *ids;
ids = NULL;
tmp_list = all_icon_factories;
while (tmp_list != NULL)
{
- GSList *these_ids;
+ GList *these_ids;
GtkIconFactory *factory = GTK_ICON_FACTORY (tmp_list->data);
these_ids = g_hash_table_get_keys (factory->icons);
- ids = g_slist_concat (ids, these_ids);
+ ids = g_list_concat (ids, these_ids);
tmp_list = g_slist_next (tmp_list);
}
/* ignore this */
void _gtk_icon_set_invalidate_caches (void);
-GSList* _gtk_icon_factory_list_ids (void);
+GList* _gtk_icon_factory_list_ids (void);
void _gtk_icon_factory_ensure_default_icons (void);
G_END_DECLS
return found != NULL;
}
-static void
-listify_foreach (gpointer key, gpointer value, gpointer data)
-{
- GSList **list = data;
-
- *list = g_slist_prepend (*list, key);
-}
-
-static GSList *
-g_hash_table_get_keys (GHashTable *table)
-{
- GSList *list = NULL;
-
- g_hash_table_foreach (table, listify_foreach, &list);
-
- return list;
-}
-
/**
* gtk_stock_list_ids:
*
GSList*
gtk_stock_list_ids (void)
{
- GSList *ids;
- GSList *icon_ids;
+ GList *ids;
+ GList *icon_ids;
GSList *retval;
- GSList *tmp_list;
const gchar *last_id;
init_stock_hash ();
ids = g_hash_table_get_keys (stock_hash);
icon_ids = _gtk_icon_factory_list_ids ();
- ids = g_slist_concat (ids, icon_ids);
+ ids = g_list_concat (ids, icon_ids);
- ids = g_slist_sort (ids, (GCompareFunc)strcmp);
+ ids = g_list_sort (ids, (GCompareFunc)strcmp);
last_id = NULL;
retval = NULL;
- tmp_list = ids;
- while (tmp_list != NULL)
+ while (ids != NULL)
{
- GSList *next;
+ GList *next;
- next = g_slist_next (tmp_list);
+ next = g_list_next (ids);
- if (last_id && strcmp (tmp_list->data, last_id) == 0)
+ if (last_id && strcmp (ids->data, last_id) == 0)
{
/* duplicate, ignore */
}
else
{
- retval = g_slist_prepend (retval, g_strdup (tmp_list->data));
- last_id = tmp_list->data;
+ retval = g_slist_prepend (retval, g_strdup (ids->data));
+ last_id = ids->data;
}
- g_slist_free_1 (tmp_list);
+ g_list_free_1 (ids);
- tmp_list = next;
+ ids = next;
}
return retval;