[gimp/goat-invasion: 366/401] app: add gimp_list_get_sort_func()



commit c995a3c343d0702344d646e06c287628da59790f
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 31 23:23:52 2012 +0200

    app: add gimp_list_get_sort_func()

 app/core/gimplist.c |   16 ++++++++++++++++
 app/core/gimplist.h |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimplist.c b/app/core/gimplist.c
index df83de5..7fcf7aa 100644
--- a/app/core/gimplist.c
+++ b/app/core/gimplist.c
@@ -448,6 +448,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
  * @sort_func: a #GCompareFunc
diff --git a/app/core/gimplist.h b/app/core/gimplist.h
index f73edb8..b6c44de 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]