From 39ee8bd2268387390a86d3485190e74e35383a1b Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 3 Aug 2018 14:08:26 +0300 Subject: [PATCH] 1) Exception on [Cancel] when closing a study. 2) Reload does not work 3) some compilation warnings --- src/SalomeApp/SalomeApp_Application.cxx | 6 +++--- src/SalomeApp/SalomeApp_DataObject.cxx | 12 ++++++------ src/SalomeApp/SalomeApp_Study.cxx | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index ec97e8c9d..635bb2bbb 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -252,14 +252,14 @@ void SalomeApp_Application::start() if ( !getStudy()->GetProperties()->IsLocked() ) { // pyfiles[j] is a dictionary: {"/absolute/path/to/script.py": [script_args]} // Path is absolute, script has .py extension - for (uint j = 0; j < pyfiles.count(); j++ ) { + for (int j = 0; j < pyfiles.count(); j++ ) { // Extract scripts and their arguments, if any QRegExp rxp ("\"(.+)\":[\\s]*\\[(.*)\\]"); if ( rxp.indexIn( pyfiles[j] ) >= 0 && rxp.capturedTexts().count() == 3 ) { QString script = rxp.capturedTexts()[1]; QString args = ""; QStringList argList = __getArgsList(rxp.capturedTexts()[2]); - for (uint k = 0; k < argList.count(); k++ ) { + for (int k = 0; k < argList.count(); k++ ) { QString arg = argList[k].trimmed(); arg.remove( QRegExp("^[\"]") ); arg.remove( QRegExp("[\"]$") ); @@ -1658,7 +1658,7 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study ) // iterate new save points. if DataObject with such ID not found in map - create DataObject // if in the map - remove it from map. - for ( int i = 0; i < savePoints.size(); i++ ) + for ( size_t i = 0; i < savePoints.size(); i++ ) if ( !mapDO.contains( savePoints[i] ) ) new SalomeApp_SavePointObject( guiRootObj, savePoints[i], study ); else diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index 2f4190519..4927cc630 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -827,13 +827,13 @@ QString SalomeApp_RootObject::toolTip( const int id ) const \param id save point ID \param study study */ -SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* parent, - const int id, +SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* parent, + const int id, SalomeApp_Study* study ) -: LightApp_DataObject( parent ), - CAM_DataObject( parent ), - myId( id ), - myStudy( study ) + : CAM_DataObject( parent ), + LightApp_DataObject( parent ), + myId( id ), + myStudy( study ) { } diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index a902c11e1..a7db412c7 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -432,7 +432,9 @@ QString SalomeApp_Study::studyName() const // it can be changed outside of GUI // TEMPORARILY SOLUTION: better to be implemented with help of SALOMEDS observers if ( studyDS() ) { - QString newName = QString::fromUtf8(studyDS()->Name().c_str()); + QString newName = QString::fromUtf8(studyDS()->URL().c_str()); + if ( newName.isEmpty() ) + newName = QString::fromUtf8(studyDS()->Name().c_str()); if ( LightApp_Study::studyName() != newName ) { SalomeApp_Study* that = const_cast( this ); that->setStudyName( newName ); -- 2.39.2