Salome HOME
Fix pb with persistence of "light" modules: SaveAs operation leads to loss of non...
authorvsr <vsr@opencascade.com>
Wed, 2 Apr 2014 08:05:48 +0000 (12:05 +0400)
committervsr <vsr@opencascade.com>
Wed, 2 Apr 2014 08:05:48 +0000 (12:05 +0400)
src/CMakeLists.txt
src/SalomeApp/CMakeLists.txt
src/SalomeApp/SalomeApp_Engine_i.cxx
src/SalomeApp/SalomeApp_Engine_i.h
src/Session/CMakeLists.txt
src/Session/Session_Session_i.cxx

index fc55f70e95917484265610f5f9da40e9a23ed8b1..08c7b287ce6eba59788e9910ca81c472ba675e5d 100755 (executable)
@@ -108,7 +108,7 @@ SET(SUBDIRS_LIGHT LightApp ResExporter)
 # Full (CORBA) SALOME packages
 ##
 IF(NOT SALOME_LIGHT_ONLY)
-  SET(SUBDIRS_CORBA TOOLSGUI Session SalomeApp GuiHelpers TreeData)
+  SET(SUBDIRS_CORBA TOOLSGUI SalomeApp Session GuiHelpers TreeData)
 ENDIF(NOT SALOME_LIGHT_ONLY)
 
 SET(SUBDIRS
index 65f278da47b472c99ebc00bcf2c2fa4b248388a5..0cbb035e0978fd3e56806016fb7277b1be2446eb 100755 (executable)
@@ -49,7 +49,6 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/STD
   ${PROJECT_SOURCE_DIR}/src/SUIT
   ${PROJECT_SOURCE_DIR}/src/SVTK
-  ${PROJECT_SOURCE_DIR}/src/Session
   ${PROJECT_SOURCE_DIR}/src/TOOLSGUI
   ${PROJECT_SOURCE_DIR}/src/VTKViewer
 )
@@ -116,7 +115,9 @@ IF(SALOME_USE_SALOMEOBJECT)
 ENDIF()
 
 IF(NOT SALOME_LIGHT_ONLY)
-  LIST(APPEND _link_LIBRARIES SalomeSession)
+  LIST(APPEND _link_LIBRARIES SalomeIDLGUI)
+  LIST(APPEND _link_LIBRARIES ${KERNEL_SalomeContainer})
+  LIST(APPEND _link_LIBRARIES ${KERNEL_SalomeLifeCycleCORBA})
 ENDIF()
 
 # --- headers ---
index c8d71de18dff415685727e06aad6f63fff9ea063..3fcbd310f95adb369bd8e11e61cf491003f1f605 100644 (file)
@@ -340,7 +340,7 @@ SALOME_NamingService* SalomeApp_Engine_i::namingService()
   \param theComponentName - synthetic "component data type" used to identify a given light module
   \return Object reference to the CORBA engine
 */
-CORBA::Object_ptr SalomeApp_Engine_i::engineForComponent( const char* theComponentName,
+CORBA::Object_ptr SalomeApp_Engine_i::EngineForComponent( const char* theComponentName,
                                                          bool toCreate )
 {
   CORBA::Object_var anEngine;
@@ -384,7 +384,7 @@ std::string SalomeApp_Engine_i::EngineIORForComponent( const char* theComponentN
                                                       bool toCreate )
 {
   std::string anIOR( "" );
-  CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+  CORBA::Object_var anEngine = EngineForComponent( theComponentName, toCreate );
   if ( !CORBA::is_nil( anEngine ) )
   {
     CORBA::String_var objStr = orb()->object_to_string( anEngine.in() );
@@ -402,7 +402,7 @@ SalomeApp_Engine_i* SalomeApp_Engine_i::GetInstance( const char* theComponentNam
                                                     bool toCreate )
 {
   SalomeApp_Engine_i* aServant = 0;
-  CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+  CORBA::Object_var anEngine = EngineForComponent( theComponentName, toCreate );
   if ( !CORBA::is_nil( anEngine ) )
   {
     PortableServer::Servant aServantBase = poa()->reference_to_servant( anEngine.in() );
index 71d63cb944e6ae882b8faa1806caa5c5cc39a934..bb565758c7925b3ba80db51d71366026e3a22d0d 100644 (file)
@@ -72,6 +72,9 @@ public:
   static SalomeApp_Engine_i* GetInstance          ( const char* theComponentName,
                                                    bool toCreate ); 
 
+  static CORBA::Object_ptr   EngineForComponent( const char* theComponentName,
+                                                bool toCreate  );
+
 public:
   // methods from SALOMEDS::Driver without implementation.  Must be redefined because 
   // there is no default implementation of SALOMEDS::Driver interface
@@ -94,9 +97,6 @@ private:
   static CORBA::ORB_var              orb();
   static PortableServer::POA_var     poa();
   static SALOME_NamingService*       namingService();
-  static CORBA::Object_ptr           engineForComponent( const char* theComponentName,
-                                                        bool toCreate  );
-
 private:
   typedef std::map<int, ListOfFiles> MapOfListOfFiles;
   MapOfListOfFiles                   myMap;
index 29c25ae6f2b81321f716a78607049ee1eacc57df..08ea8d390dc07184906ab473cd1dd7256568352f 100755 (executable)
@@ -28,10 +28,12 @@ INCLUDE_DIRECTORIES(
   ${OMNIORB_INCLUDE_DIR}
   ${PTHREAD_INCLUDE_DIR}
   ${PROJECT_BINARY_DIR}
+  ${PROJECT_BINARY_DIR}/idl
   ${PROJECT_SOURCE_DIR}/src/Qtx
   ${PROJECT_SOURCE_DIR}/src/SUIT
   ${PROJECT_SOURCE_DIR}/src/Event
   ${PROJECT_SOURCE_DIR}/src/Style
+  ${PROJECT_SOURCE_DIR}/src/SalomeApp
 )
 
 # additional preprocessor / compiler flags
@@ -63,7 +65,7 @@ SET(_link_LIBRARIES
   ${KERNEL_SalomeLauncher}
   ${KERNEL_Registry}
   ${KERNEL_SALOMEBasics}
-  qtx suit Event SalomeStyle SalomeIDLGUI
+  qtx suit Event SalomeStyle SalomeApp SalomeIDLGUI
 )
 IF(ENABLE_TESTRECORDER)
   LIST(APPEND _link_LIBRARIES ${TESTRECORDER_LIBS})
index 0e08eb3e52222fd1f237681720d766301b469953..c5bb83a04fe7f5617f2351a5c5b028084f468cdc 100755 (executable)
@@ -29,7 +29,7 @@
 
 #include "SALOME_NamingService.hxx"
 #include "SALOME_Event.h"
-
+#include "SalomeApp_Engine_i.h"
 #include "SUIT_Session.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_Study.h"
@@ -80,10 +80,16 @@ Engines::EngineComponent_ptr SALOME_Session_i::GetComponent(const char* theLibra
   typedef Engines::EngineComponent_ptr TGetImpl(CORBA::ORB_ptr,
                                                 PortableServer::POA_ptr,
                                                 SALOME_NamingService*,QMutex*);
-  OSD_SharedLibrary  aSharedLibrary(const_cast<char*>(theLibraryName));
-  if(aSharedLibrary.DlOpen(OSD_RTLD_LAZY))
-    if(OSD_Function anOSDFun = aSharedLibrary.DlSymb("GetImpl"))
+  OSD_SharedLibrary aSharedLibrary(const_cast<char*>(theLibraryName));
+  if (aSharedLibrary.DlOpen(OSD_RTLD_LAZY)) {
+    if (OSD_Function anOSDFun = aSharedLibrary.DlSymb("GetImpl"))
       return ((TGetImpl (*)) anOSDFun)(_orb,_poa,_NS,_GUIMutex);
+  }
+  CORBA::Object_var obj = SalomeApp_Engine_i::EngineForComponent(theLibraryName, true);
+  if (!CORBA::is_nil(obj)){
+    Engines::EngineComponent_var anEngine = Engines::EngineComponent::_narrow(obj);
+    return anEngine._retn();
+  }
   return Engines::EngineComponent::_nil();
 }