Salome HOME
Fix for "23661: [CEA 13186] Notebook: update study error" issue.
authorrnv <rnv@opencascade.com>
Thu, 17 Jan 2019 08:30:20 +0000 (11:30 +0300)
committervsr <vsr@opencascade.com>
Mon, 25 Feb 2019 12:22:38 +0000 (15:22 +0300)
src/SalomeApp/SalomeApp_Application.cxx

index 50a021ef1d02891b24e6e3ea68ec75642e69ee4c..50544cd2d243c58fa9bf64a66f8b08530c171ed8 100644 (file)
@@ -1949,6 +1949,7 @@ bool SalomeApp_Application::updateStudy()
 
   // get unique temporary directory name
   QString aTmpDir = QString::fromStdString( SALOMEDS_Tool::GetTmpDir() );
+
   if( aTmpDir.isEmpty() )
     return false;
 
@@ -2035,8 +2036,8 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript,
   SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
 
   // load study from the temporary directory
-
-  QString command = QString( "exec(open(\"%1\" ,\"rb\").read())" ).arg( theDumpScript );
+  QFileInfo aScriptInfo = QFileInfo(theDumpScript);
+  QString command = QString( "exec(open(\"%1\" ,\"rb\").read())" ).arg(aScriptInfo.canonicalFilePath());
 
 #ifndef DISABLE_PYCONSOLE
   PyConsole_Console* pyConsole = app->pythonConsole();
@@ -2045,7 +2046,6 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript,
 #endif
 
   // remove temporary directory
-  QFileInfo aScriptInfo = QFileInfo( theDumpScript );
   QString aStudyName = aScriptInfo.baseName();
   QDir aDir = aScriptInfo.absoluteDir();
   QStringList aFiles = aDir.entryList( QStringList( "*.py*" ) );