Salome HOME
CAM resources loading added.
[modules/gui.git] / src / SalomeApp / SalomeApp_Study.cxx
index c7dff3b6885e6a9968b98af391328621e9f6e95b..0ba477280f0f016308cc045ff753a1b85cb8ddbe 100644 (file)
@@ -39,11 +39,13 @@ void SalomeApp_Study::createDocument()
   MESSAGE( "openDocument" );
 
   // initialize myStudyDS, read HDF file
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( newStudyName().latin1() ) );
+  QString aName = newStudyName();
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.latin1() ) );
   if ( !study )
     return;
 
   setStudyDS( study );
+  setStudyName( aName );
 
   // create myRoot
   setRoot( new SalomeApp_RootObject( this ) );
@@ -187,10 +189,10 @@ void SalomeApp_Study::closeDocument()
   emit closed( this );
 
   // close SALOMEDS document
-  _PTR(Study) st = studyDS();
-  if ( st.get() )
+  _PTR(Study) studyPtr = studyDS();
+  if ( studyPtr )
   {
-    SalomeApp_Application::studyMgr()->Close( st );
+    SalomeApp_Application::studyMgr()->Close( studyPtr );
     SALOMEDSClient_Study* aStudy = 0;
     setStudyDS( _PTR(Study)(aStudy) );
   }