diff --git a/app/core/gimplist.c b/app/core/gimplist.c index df83de5765..7fcf7aab39 100644 --- a/app/core/gimplist.c +++ b/app/core/gimplist.c @@ -447,6 +447,22 @@ gimp_list_set_sort_func (GimpList *list, } } +/** + * gimp_list_get_sort_func: + * @list: a #GimpList + * + * Returns the @list's sort function, see gimp_list_set_sort_func(). + * + * Return Value: The @list's sort function. + **/ +GCompareFunc +gimp_list_get_sort_func (GimpList*list) +{ + g_return_val_if_fail (GIMP_IS_LIST (list), NULL); + + return list->sort_func; +} + /** * gimp_list_sort: * @list: a #GimpList diff --git a/app/core/gimplist.h b/app/core/gimplist.h index f73edb864e..b6c44de9e3 100644 --- a/app/core/gimplist.h +++ b/app/core/gimplist.h @@ -61,6 +61,7 @@ GimpContainer * gimp_list_new_weak (GType children_type, void gimp_list_reverse (GimpList *list); void gimp_list_set_sort_func (GimpList *list, GCompareFunc sort_func); +GCompareFunc gimp_list_get_sort_func (GimpList *list); void gimp_list_sort (GimpList *list, GCompareFunc sort_func); void gimp_list_sort_by_name (GimpList *list);