From beb898d9ee62ed437c3744feb81354591f08f686 Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 28 Mar 2006 10:55:17 +0000 Subject: [PATCH] PAL12025 - GUI states must be last object branch in ObjectBrowser --- src/SUIT/SUIT_TreeSync.h | 6 ++---- src/SalomeApp/SalomeApp_Application.cxx | 14 ++++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/SUIT/SUIT_TreeSync.h b/src/SUIT/SUIT_TreeSync.h index 19bdf4edd..b39b539ae 100644 --- a/src/SUIT/SUIT_TreeSync.h +++ b/src/SUIT/SUIT_TreeSync.h @@ -48,7 +48,6 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) diffSiblings( r1, r2, d, td ); typename QValueList< DiffItem< SrcItem, TrgItem > >::const_iterator anIt = d.begin(), aLast = d.end(); - bool isFirst = true; TrgItem lastItem = td.nullTrg(); // TrgItem tail = td.nullTrg(); for( ; anIt!=aLast; anIt++ ) @@ -64,7 +63,7 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) if( item.myTrg==td.nullTrg() ) { //to add - lastItem = createSubTree( item.mySrc, r2, lastItem, isFirst, td ); + lastItem = createSubTree( item.mySrc, r2, lastItem, lastItem==td.nullTrg(), td ); } else { @@ -73,7 +72,6 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) synchronize( item.mySrc, item.myTrg, td ); lastItem = item.myTrg; } - isFirst = false; } } @@ -81,7 +79,7 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) } else { - TrgItem new_r2 = createSubTree( r1, td.parent( r2 ), r2, false, td ); + TrgItem new_r2 = createSubTree( r1, td.parent( r2 ), r2, r2==td.nullTrg(), td ); if( r2!=td.nullTrg() ) td.deleteItemWithChildren( r2 ); return new_r2; diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index f3af5012b..f8b9900e0 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -850,15 +850,11 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) } } - // 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(); + // update existing data models (already loaded SComponents) + LightApp_Application::updateObjectBrowser( updateModels ); } /*!Display Catalog Genenerator dialog */ @@ -1077,14 +1073,12 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study ) for ( int i = 0; i < savePoints.size(); i++ ) if ( !mapDO.contains( savePoints[i] ) ) new SalomeApp_SavePointObject( guiRootObj, savePoints[i], study ); - else { - ob->updateTree( mapDO[ savePoints[i] ] ); + else mapDO.remove( savePoints[i] ); - } + // delete DataObjects that are still in the map -- their IDs were not found in data model for ( QMap::Iterator it = mapDO.begin(); it != mapDO.end(); ++it ) delete it.data(); - ob->updateTree(study->root(), false); } -- 2.39.2