static gint gwy_app_file_chooser_type_compare(gconstpointer a, gconstpointer b) { return g_utf8_collate(_(gwy_file_func_get_description((const gchar*)a)), _(gwy_file_func_get_description((const gchar*)b))); }
static void gwy_app_file_chooser_add_types(GtkListStore *store, GwyFileOperationType fileop, gboolean only_nondetectable) { TypeListData tldata; GtkTreeIter iter; GSList *l; tldata.list = NULL; tldata.fileop = fileop; tldata.only_nondetectable = only_nondetectable; gwy_file_func_foreach((GFunc)gwy_app_file_chooser_add_type, &tldata); tldata.list = g_slist_sort(tldata.list, gwy_app_file_chooser_type_compare); for (l = tldata.list; l; l = g_slist_next(l)) { gtk_list_store_insert_with_values (store, &iter, G_MAXINT, COLUMN_FILETYPE, l->data, COLUMN_LABEL, gettext(gwy_file_func_get_description(l->data)), -1); } g_slist_free(tldata.list); }