]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
BugID 12025, partly fixed bug, no more fictive "GUI state" objects appears in Object...
authorsrn <srn@opencascade.com>
Tue, 28 Mar 2006 08:09:29 +0000 (08:09 +0000)
committersrn <srn@opencascade.com>
Tue, 28 Mar 2006 08:09:29 +0000 (08:09 +0000)
src/SalomeApp/SalomeApp_Application.cxx

index 0906ec0352b9cd3014f1979edb8074dfd5540dca..f3af5012bed8bf954435791a8fdd095443006cab 100644 (file)
@@ -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<int,SalomeApp_SavePointObject*>::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);
 }