X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FGuiHelpers%2FSALOME_GuiServices.cxx;h=8f1e215ba56561df3015302aa0008155c0a4a064;hb=b6e35aa42d3c67a529d7f9339718dfaed6891323;hp=76d1dc0812aa422370a3c93542b8d3481394dbb3;hpb=91cc8846bfa36302f7ade6cb8aa380f03e90423e;p=modules%2Fgui.git diff --git a/src/GuiHelpers/SALOME_GuiServices.cxx b/src/GuiHelpers/SALOME_GuiServices.cxx index 76d1dc081..8f1e215ba 100644 --- a/src/GuiHelpers/SALOME_GuiServices.cxx +++ b/src/GuiHelpers/SALOME_GuiServices.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -68,31 +68,14 @@ namespace GUI { // SALOME application using the resourceMgr() method: // - /** - * This returns the current active study id if an active study is - * defined in the SALOME session, returns -1 otherwise. Note that - * the active study doesn't make sense outside of the GUI SALOME - * process, i.e. the SALOME_SessionServer embedding the - * SalomeApp_Application. - */ - int getActiveStudyId() { - SALOME::Session_var aSession = KERNEL::getSalomeSession(); - if ( CORBA::is_nil(aSession) ) { - INFOS("ERR: can't request for active study because the session is NULL"); - return -1; - } - return aSession->GetActiveStudyId(); - } - /** * This returns the current active study if an active study is * defined in the SALOME session, returns null otherwise. */ - SALOMEDS::Study_ptr getActiveStudy() { - return KERNEL::getStudyById(getActiveStudyId()); + SALOMEDS::Study_ptr getStudyServant() { + return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant()); } - // __GBO__ Question: what is the difference between a // SALOMEDS::Study and a SalomeApp_Study? SalomeApp_Study* getSalomeAppActiveStudy() { @@ -120,9 +103,7 @@ namespace GUI { // retrieve the SALOMEDS::Study servant first and the to // request this servant to get the SObject given its entry. // - _PTR(Study) studyClient = appStudy->studyDS(); - SALOMEDS::Study_var study = KERNEL::getStudyManager()->GetStudyByID(studyClient->StudyId()); - SALOMEDS::SObject_ptr sobject = study->FindObjectID(iobject->getEntry()); + SALOMEDS::SObject_ptr sobject = KERNEL::getStudyServant()->FindObjectID(iobject->getEntry()); return sobject; } }