From a204f9f3c8e414906e8e595559972b4e64fc24f7 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 aaf5ad2bf..ecb18d0f9 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1953,6 +1953,7 @@ bool SalomeApp_Application::updateStudy() // get unique temporary directory name QString aTmpDir = QString::fromStdString( SALOMEDS_Tool::GetTmpDir() ); + if( aTmpDir.isEmpty() ) return false; @@ -2039,8 +2040,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(); @@ -2049,7 +2050,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