SUIT_Application* aApp = 0;
for (unsigned int ind = 0; ind < List.size(); ind++) {
- studyname = List[ind];
+ studyname = List[ind].c_str();
//Add to list only unloaded studies
bool isAlreadyOpen = false;
for ( QPtrListIterator<SUIT_Application> it( aAppList ); it.current() && !isAlreadyOpen; ++it )
if ( aComponent->ComponentDataType() == "Interface Applicative" )
continue; // skip the magic "Interface Applicative" component
-
+
SalomeApp_DataModel::BuildTree( aComponent, study->root(), study, /*skipExisitng=*/true );
}
}
#include <SUIT_Application.h>
#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
#include "SALOMEDS_Tool.hxx"
{
QString aSName( aSComp->GetName().c_str() );
DataObjectList allComponents = parent->children( /*recursive=*/false );
- for ( DataObjectListIterator it( allComponents ); it.current(); ++it )
- if ( it.current()->name() == aSName )
- return it.current();
+ for ( DataObjectListIterator it( allComponents ); it.current(); ++it ) {
+ SUIT_DataObject* componentObj = it.current();
+ if ( componentObj->name() == aSName ) {
+ //mkr : modifications for update already published in
+ //object browser, but not loaded yet component
+ //get names list of loaded modules
+ QStringList aLoadedModNames;
+ CAM_Application* anApp = dynamic_cast<CAM_Application*>( SUIT_Session::session()->activeApplication() );
+ if ( anApp ) anApp->modules( aLoadedModNames, /*loaded*/true );
+ if ( !aLoadedModNames.isEmpty() && aLoadedModNames.contains( aSName ) == 0 ) {
+ // delete DataObject and re-create it and all its sub-objects
+ delete componentObj;
+ // don't do anything here, because iterator may be corrupted (deleted object inside it)
+ break;
+ }
+ else
+ return componentObj;
+ }
+ }
}
aDataObj = aSComp ? new SalomeApp_ModuleObject( aSComp, parent ) :