[gimp] app: fix GimpTaggedContainer's base class



commit 014a333d271053ff34793f217af8a73e778f9d65
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 23 21:51:56 2011 +0100

    app: fix GimpTaggedContainer's base class
    
    And make it use the sort_func from the src_container which must
    now be a GimpList (which is likely temporary).

 app/core/gimptaggedcontainer.c    |    9 +++++----
 app/core/gimptaggedcontainer.h    |    5 ++---
 app/widgets/gimpdatafactoryview.c |    3 +--
 3 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/app/core/gimptaggedcontainer.c b/app/core/gimptaggedcontainer.c
index 77a20d9..316a475 100644
--- a/app/core/gimptaggedcontainer.c
+++ b/app/core/gimptaggedcontainer.c
@@ -267,15 +267,16 @@ gimp_tagged_container_get_memsize (GimpObject *object,
  * Return value: a new #GimpTaggedContainer object.
  **/
 GimpContainer *
-gimp_tagged_container_new (GimpContainer *src_container,
-                           GCompareFunc   sort_func)
+gimp_tagged_container_new (GimpContainer *src_container)
 {
   GimpTaggedContainer *tagged_container;
-  GType                  children_type;
+  GType                children_type;
+  GCompareFunc         sort_func;
 
-  g_return_val_if_fail (GIMP_IS_CONTAINER (src_container), NULL);
+  g_return_val_if_fail (GIMP_IS_LIST (src_container), NULL);
 
   children_type = gimp_container_get_children_type (src_container);
+  sort_func     = GIMP_LIST (src_container)->sort_func;
 
   tagged_container = g_object_new (GIMP_TYPE_TAGGED_CONTAINER,
                                    "sort-func",     sort_func,
diff --git a/app/core/gimptaggedcontainer.h b/app/core/gimptaggedcontainer.h
index 86bc2b3..5633ee1 100644
--- a/app/core/gimptaggedcontainer.h
+++ b/app/core/gimptaggedcontainer.h
@@ -47,7 +47,7 @@ struct _GimpTaggedContainer
 
 struct _GimpTaggedContainerClass
 {
-  GimpContainerClass  parent_class;
+  GimpListClass  parent_class;
 
   void (* tag_count_changed) (GimpTaggedContainer *container,
                               gint                   count);
@@ -56,8 +56,7 @@ struct _GimpTaggedContainerClass
 
 GType           gimp_tagged_container_get_type      (void) G_GNUC_CONST;
 
-GimpContainer * gimp_tagged_container_new           (GimpContainer       *src_container,
-                                                     GCompareFunc         sort_func);
+GimpContainer * gimp_tagged_container_new           (GimpContainer       *src_container);
 
 void            gimp_tagged_container_set_filter    (GimpTaggedContainer *tagged_container,
                                                      GList               *tags);
diff --git a/app/widgets/gimpdatafactoryview.c b/app/widgets/gimpdatafactoryview.c
index 61603f9..54dcb52 100644
--- a/app/widgets/gimpdatafactoryview.c
+++ b/app/widgets/gimpdatafactoryview.c
@@ -242,8 +242,7 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
   factory_view->priv->factory = factory;
 
   factory_view->priv->tagged_container =
-    gimp_tagged_container_new (gimp_data_factory_get_container (factory),
-                               (GCompareFunc) gimp_data_compare);
+    gimp_tagged_container_new (gimp_data_factory_get_container (factory));
 
   if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (factory_view),
                                          view_type,



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