From: srn Date: Tue, 28 Mar 2006 08:09:29 +0000 (+0000) Subject: BugID 12025, partly fixed bug, no more fictive "GUI state" objects appears in Object... X-Git-Tag: for_sharm~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f78f5c9ed3740f5ba439dd9bb6a598529c4cd21;p=modules%2Fgui.git BugID 12025, partly fixed bug, no more fictive "GUI state" objects appears in Object Browser. Still the order of "GUI state" root object is not correct. It must be the last object in the object browser. --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 0906ec035..f3af5012b 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -848,13 +848,14 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) //SalomeApp_DataModel::BuildTree( aComponent, study->root(), study, /*skipExisitng=*/true ); } } - // create data objects that correspond to GUI state save points - updateSavePointDataObjects( study ); } // update existing data models (already loaded SComponents) LightApp_Application::updateObjectBrowser( updateModels ); + // create data objects that correspond to GUI state save points + if ( study ) updateSavePointDataObjects( study ); + // -- debug -- // if ( study && study->root() ) // study->root()->dump(); @@ -1055,11 +1056,10 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study ) // case 4: everything already exists.. here may be a problem: we want "GUI states" root object // to be always the last one in the tree. Here we check - if it is not the last one - remove and // re-create it. - bool isOpen( false ); if ( guiRootObj->nextBrother() ) { - isOpen = isListViewItemOpen( ob->listView(), guiRootObj ); - delete guiRootObj; - guiRootObj = new SalomeApp_SavePointRootObject( study->root() ); + study->root()->removeChild(guiRootObj); + study->root()->appendChild(guiRootObj); + //study->root()->dump(); } // store data objects in a map id-to-DataObject @@ -1085,7 +1085,6 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study ) for ( QMap::Iterator it = mapDO.begin(); it != mapDO.end(); ++it ) delete it.data(); - if ( isOpen ) // set open if we recreated guiRootObj and it was previously open.. - guiRootObj->setOpen( true ); + ob->updateTree(study->root(), false); }