ci->pixbuf = pixbuf;
}
-/* an ugly static var, well what ya gonna do ? */
-static SortType collection_list_sort_method = SORT_NAME;
-
-static gint collection_list_sort_cb(gconstpointer a, gconstpointer b)
+static gint collection_list_sort_cb(gconstpointer a, gconstpointer b,
+ gpointer user_data)
{
auto cia = static_cast<const CollectInfo *>(a);
auto cib = static_cast<const CollectInfo *>(b);
- switch (collection_list_sort_method)
+ switch (GPOINTER_TO_INT(user_data))
{
- case SORT_NAME:
- break;
case SORT_NONE:
return 0;
break;
{
if (method == SORT_NONE) return list;
- collection_list_sort_method = method;
-
- return g_list_sort(list, collection_list_sort_cb);
+ return g_list_sort_with_data(list, collection_list_sort_cb, GINT_TO_POINTER(method));
}
static GList *collection_list_randomize(GList *list)
{
if (method != SORT_NONE)
{
- collection_list_sort_method = method;
- list = g_list_insert_sorted(list, ci, collection_list_sort_cb);
+ list = g_list_insert_sorted_with_data(list, ci, collection_list_sort_cb, GINT_TO_POINTER(method));
}
else
{
{
if (method != SORT_NONE)
{
- collection_list_sort_method = method;
- list = g_list_insert_sorted(list, ci, collection_list_sort_cb);
+ list = g_list_insert_sorted_with_data(list, ci, collection_list_sort_cb, GINT_TO_POINTER(method));
}
else
{