From ac8d83014d4d2f1d6fc8a1e9e5b0958e067362f1 Mon Sep 17 00:00:00 2001 From: srn Date: Mon, 20 Feb 2006 11:28:07 +0000 Subject: [PATCH] Replaced a usage of SALOMEDS objects with calls to SALOMEDSClient wrappers --- src/SalomeApp/SalomeApp_Application.cxx | 18 +++++++----------- src/SalomeApp/SalomeApp_TypeFilter.cxx | 2 -- src/Session/Session_ServerThread.cxx | 13 +++---------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 5139ce4f2..afe4b2b87 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -49,15 +49,14 @@ #include #include -#include "SALOMEDS_StudyManager.hxx" -#include "SALOMEDS_SObject.hxx" - #include "SALOME_ListIteratorOfListIO.hxx" #include "SALOME_ListIO.hxx" #include "ToolsGUI_CatalogGeneratorDlg.h" #include "ToolsGUI_RegWidget.h" +#include + /*!Create new instance of SalomeApp_Application.*/ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication() { @@ -362,12 +361,8 @@ void SalomeApp_Application::onSelectionChanged() _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry()); if ( so ) { - SALOMEDS_SObject* aSO = dynamic_cast(so.get()); - - if ( aSO ) { - canCopy = studyMgr()->CanCopy(so); - canPaste = studyMgr()->CanPaste(so); - } + canCopy = studyMgr()->CanCopy(so); + canPaste = studyMgr()->CanPaste(so); } } } @@ -630,8 +625,9 @@ CORBA::ORB_var SalomeApp_Application::orb() /*!Create and return SALOMEDS_StudyManager.*/ SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr() { - static SALOMEDSClient_StudyManager* _sm = new SALOMEDS_StudyManager(); - return _sm; + static _PTR(StudyManager) _sm; + if(!_sm) _sm = ClientFactory::StudyManager(); + return _sm.get(); } /*!Create and return SALOME_NamingService.*/ diff --git a/src/SalomeApp/SalomeApp_TypeFilter.cxx b/src/SalomeApp/SalomeApp_TypeFilter.cxx index 58ab6bb57..5cedb609c 100644 --- a/src/SalomeApp/SalomeApp_TypeFilter.cxx +++ b/src/SalomeApp/SalomeApp_TypeFilter.cxx @@ -21,8 +21,6 @@ #include "LightApp_DataOwner.h" #include "SalomeApp_Study.h" -#include - /*! Constructor. */ diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 7e3714518..a0d00d9ea 100755 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -34,7 +34,8 @@ #include "SALOME_Container_i.hxx" #include "SALOME_ContainerManager.hxx" -#include "SALOMEDS_StudyManager_i.hxx" +#include +#include #include "SALOME_ModuleCatalog_impl.hxx" #include "RegistryService.hxx" #include "Session_Session_i.hxx" @@ -246,15 +247,7 @@ void Session_ServerThread::ActivateSALOMEDS(int argc, // counted objects, they will be deleted by the POA when they are no // longer needed. - SALOMEDS_StudyManager_i * myStudyManager_i - = new SALOMEDS_StudyManager_i(_orb,_root_poa); - - // Activate the objects. This tells the POA that the objects are - // ready to accept requests. - - PortableServer::ObjectId_var myStudyManager_iid - = _root_poa->activate_object(myStudyManager_i); - myStudyManager_i->register_name("/myStudyManager"); + ClientFactory::createStudyManager(_orb,_root_poa); } catch(CORBA::SystemException&) { -- 2.39.2