[gegl/wip/rishi/node-connect: 1/2] GeglNode: Clean up



commit 6c3efef409e09325cfb4d21c5f50e82582c95bc0
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Mar 2 14:22:16 2016 +0100

    GeglNode: Clean up
    
    Since gegl_node_pads_exist already logs a WARNING when the pads can't
    be found, there is no need to log another one in the caller. This will
    also help us short gegl_node_connect_from when its parameters are
    already connected, and avoid a needless invalidation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762987

 gegl/graph/gegl-node.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 28fc738..99b5af2 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -722,31 +722,15 @@ gegl_node_connect_from (GeglNode    *sink,
       real_source_pad_name = "output";
     }
 
-  {
-    GeglPad *pad;
-    GeglPad *other_pad = NULL;
-
-    pad = gegl_node_get_pad (real_sink, real_sink_pad_name);
-    if (pad)
-      other_pad = gegl_pad_get_connected_to (pad);
-    else
-      {
-        g_warning ("%s: Didn't find pad '%s' of '%s'",
-                   G_STRFUNC, real_sink_pad_name, gegl_node_get_debug_name (real_sink));
-      }
-
-    if (other_pad)
-      {
-        gegl_node_disconnect (real_sink, real_sink_pad_name);
-      }
-  }
   if (gegl_node_pads_exist (real_sink, real_sink_pad_name, real_source, real_source_pad_name))
     {
       GeglPad        *sink_pad   = gegl_node_get_pad (real_sink, real_sink_pad_name);
       GeglPad        *source_pad = gegl_node_get_pad (real_source, real_source_pad_name);
-      GeglConnection *connection = gegl_pad_connect (sink_pad,
-                                                     source_pad);
+      GeglConnection *connection;
+
+      gegl_node_disconnect (real_sink, real_sink_pad_name);
 
+      connection = gegl_pad_connect (sink_pad, source_pad);
       gegl_connection_set_sink_node (connection, real_sink);
       gegl_connection_set_source_node (connection, real_source);
 


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