Salome HOME
#29456 [EDF] (2022-T1) Finalization of SSL implementation
[modules/med.git] / src / MEDCalc / gui / MEDModule.cxx
index 78659c775256679c4a26adc76ed9d96df5e6578a..c71d4bf8a4b9bd156e33ef995172b8a7ff192bc4 100644 (file)
@@ -51,7 +51,6 @@
 
 #include "MEDFactoryClient.hxx"
 #include "MEDPresentationManager_i.hxx"
-#include "MED_Component_Generator.hxx"
 
 #include <QTimer>
 #include <sstream>
@@ -110,23 +109,14 @@ void
 MEDModule::init()
 {
   // initialize FIELDS module engine (load, if necessary)
-  Engines::EngineComponent_var comp;
-  if ( CORBA::is_nil( _MED_engine ) ) {
-    SALOME_NamingService_Abstract *ns = SalomeApp_Application::namingService();
-    if( dynamic_cast<SALOME_NamingService *>(ns) )
-    {
-      comp = SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "FIELDS" );
-    }
-    else
-    {
-      comp = RetrieveMEDInstance();
-      CORBA::Object_var comp2 = CORBA::Object::_narrow(comp);
-      KERNEL::RegisterCompo("FIELDS",comp2);
-    }
-    _MED_engine = MED_ORB::MED_Gen::_narrow( comp );
-    if (CORBA::is_nil( _MED_engine )) {
-      STDLOG("Could not narrow FIELDS engine");
-    }
+       
+  if (CORBA::is_nil(_MED_engine)) {
+       Engines::EngineComponent_var comp = 
+               SalomeApp_Application::lcc()->FindOrLoad_Component("FactoryServer", "FIELDS");
+       _MED_engine = MED_ORB::MED_Gen::_narrow(comp);
+  }
+  if (CORBA::is_nil( _MED_engine )) {
+    STDLOG("Could not narrow FIELDS engine");
   }
 }