]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
INT PAL 0052839: SALOME crashes at Reopen if the file was renamed
authormpa <mpa@opencascade.com>
Fri, 28 Aug 2015 12:35:22 +0000 (15:35 +0300)
committermpa <mpa@opencascade.com>
Fri, 28 Aug 2015 12:35:22 +0000 (15:35 +0300)
src/STD/STD_Application.cxx

index dee6fd199a455cc56e772c4610e5222e39b26ffd..557371ac0b7cddb44354fc0b06445f6c3bba2d81 100755 (executable)
@@ -356,8 +356,6 @@ bool STD_Application::onReopenDoc()
     // update views / windows / status bar / title
     clearViewManagers();
     setActiveStudy( 0 );
-    updateDesktopTitle();
-    updateCommandsStatus();
 
     // delete study
     delete study;
@@ -366,13 +364,21 @@ bool STD_Application::onReopenDoc()
     // post closing actions
     afterCloseDoc();
 
+    int aNbStudies = 0;
+    QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+    for ( int i = 0; i < apps.count(); i++ )
+      aNbStudies += apps.at( i )->getNbStudies();
+
     // reload study from the file
     res = useFile( studyName ) && activeStudy();
 
     // if reloading is failed, close the desktop
-    if ( !res ) {
-      setDesktop( 0 );
+    if ( aNbStudies && !res )
       closeApplication();
+    else
+    {
+      updateDesktopTitle();
+      updateCommandsStatus();
     }
   }
   return res;