From a131463459fd9bed9a5aee2ef912620e9457799b Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 20 Jul 2005 05:59:50 +0000 Subject: [PATCH] BugID IPAL9021, modified a method loadDocument. Put there a code from method openDocument to update the ObjectBrowser when the unloaded study is loaded back. --- src/SalomeApp/SalomeApp_Study.cxx | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 2a4bb8c86..aa1487796 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -104,27 +104,25 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) setStudyDS( study ); - // build a SUIT_DataObject-s tree under myRoot member field - // 1. create myRoot - setRoot( new SalomeApp_RootObject( this ) ); - // 2. iterate through all components and create corresponding sub-trees under them - _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); - for ( ; it->More(); it->Next() ) { - // don't use shared_ptr here, for Data Object will take - // ownership of this pointer - _PTR(SComponent) aComponent ( it->Value() ); + setRoot( new SalomeApp_RootObject( this ) ); // create myRoot - if ( aComponent->ComponentDataType() == "Interface Applicative" ) - continue; // skip the magic "Interface Applicative" component + //SRN: BugID IPAL9021, put there the same code as in a method openDocument - SalomeApp_DataModel::BuildTree( aComponent, root(), this ); - } + // update loaded data models: call open() and update() on them. + ModelList dm_s; + dataModels( dm_s ); + for ( ModelListIterator it( dm_s ); it.current(); ++it ) + openDataModel( studyName(), it.current() ); + + // this will build a SUIT_DataObject-s tree under myRoot member field + // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step + // but tree that corresponds to not-loaded data models will be updated any way. + ((SalomeApp_Application*)application())->updateObjectBrowser( false ); - // TODO: potentially unsafe call, since base study's openDocument() might try to access the file directly - to be improved - //bool res = true; bool res = CAM_Study::openDocument( theStudyName ); + emit opened( this ); - //emit opened( this ); + //SRN: BugID IPAL9021: End return res; } -- 2.39.2