From c0ed5275188e697a38383a0e06d0cc1e86cd28c9 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 17 Jan 2019 11:30:20 +0300 Subject: [PATCH] Fix for "23661: [CEA 13186] Notebook: update study error" issue. --- src/SalomeApp/SalomeApp_Application.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 50a021ef1..50544cd2d 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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( 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*" ) ); -- 2.39.2