]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Workspace.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / Workspace.cxx
index b37c2caa8b5c92d2418c6450515389847350f3a3..c56897e2b1cbc317f67b6397d2736d35fb42505e 100644 (file)
@@ -211,27 +211,30 @@ Connect(
     return( false );
 
   // Real connection
-  dest->SetInput( input_name, orig->GetOutputPort( output_name ) );
-  this->m_Graph->AddEdge(
-    orig_filter, dest_filter,
-    TConnection( output_name, input_name )
-    );
-  return( false );
+  if( dest->SetInput( input_name, orig->GetOutput( output_name ) ) )
+  {
+    this->m_Graph->AddEdge(
+      orig_filter, dest_filter,
+      TConnection( output_name, input_name )
+      );
+    return( true );
+  }
+  else
+    return( false );
 }
 
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::Workspace::
-Connect( TData::Pointer* input_object, const std::string& input_name )
+Connect(
+  const ProcessObjectPort& input_port, const std::string& exposed_port
+  )
 {
-  auto port = this->m_ExposedInputPorts.find( input_name );
+  auto port = this->m_ExposedInputPorts.find( exposed_port );
   if( port != this->m_ExposedInputPorts.end( ) )
   {
     TFilter* filter = this->GetFilter( port->second.first );
     if( filter != NULL )
-    {
-      filter->SetInput( port->second.second, input_object );
-      return( true );
-    }
+      return( filter->SetInput( port->second.second, input_port ) );
     else
       return( false );
   }