gimp r27228 - in trunk: . app/core



Author: mitch
Date: Sat Oct 11 10:18:46 2008
New Revision: 27228
URL: http://svn.gnome.org/viewvc/gimp?rev=27228&view=rev

Log:
2008-10-11  Michael Natterer  <mitch gimp org>

	* app/core/gimpdrawablestack.c: add GimpContainer::add()
	implementation, it's needed after all even though everybody uses
	gimp_container_insert() on drawable stacks.

	(gimp_drawable_stack_remove_node): no need to have a special check
	for newly added nodes, this can't happen any more now that we have
	an add() impl.

	(gimp_drawable_stack_get_graph): free the reverse list.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpdrawablestack.c

Modified: trunk/app/core/gimpdrawablestack.c
==============================================================================
--- trunk/app/core/gimpdrawablestack.c	(original)
+++ trunk/app/core/gimpdrawablestack.c	Sat Oct 11 10:18:46 2008
@@ -46,6 +46,8 @@
 
 static void   gimp_drawable_stack_finalize    (GObject           *object);
 
+static void   gimp_drawable_stack_add         (GimpContainer     *container,
+                                               GimpObject        *object);
 static void   gimp_drawable_stack_remove      (GimpContainer     *container,
                                                GimpObject        *object);
 static void   gimp_drawable_stack_reorder     (GimpContainer     *container,
@@ -71,6 +73,7 @@
 
   object_class->finalize   = gimp_drawable_stack_finalize;
 
+  container_class->add     = gimp_drawable_stack_add;
   container_class->remove  = gimp_drawable_stack_remove;
   container_class->reorder = gimp_drawable_stack_reorder;
 }
@@ -95,6 +98,18 @@
 }
 
 static void
+gimp_drawable_stack_add (GimpContainer *container,
+                         GimpObject    *object)
+{
+  GimpDrawableStack *stack = GIMP_DRAWABLE_STACK (container);
+
+  GIMP_CONTAINER_CLASS (parent_class)->add (container, object);
+
+  if (stack->graph)
+    gimp_drawable_stack_add_node (stack, GIMP_DRAWABLE (object));
+}
+
+static void
 gimp_drawable_stack_remove (GimpContainer *container,
                             GimpObject    *object)
 {
@@ -181,6 +196,8 @@
       previous = node;
     }
 
+  g_list_free (reverse_list);
+
   output = gegl_node_get_output_proxy (stack->graph, "output");
 
   if (previous)
@@ -245,11 +262,7 @@
   GeglNode     *node;
   gint          index;
 
-  node = gimp_drawable_get_node (GIMP_DRAWABLE (drawable));
-
-  /*  bail out if the layer was newly added  */
-  if (! gegl_node_get_consumers (node, "output", NULL, NULL))
-    return;
+  node = gimp_drawable_get_node (drawable);
 
   index = gimp_container_get_child_index (GIMP_CONTAINER (stack),
                                           GIMP_OBJECT (drawable));



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