#include "utilities.h"
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
}
}
// To remove IOs, which is not selected.
- SALOME_ListIO aRemoveList;
- SALOME_ListIteratorOfListIO anAppendListIter(anAppendList);
- for(; anAppendListIter.More(); anAppendListIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = anAppendListIter.Value();
- SALOME_ListIteratorOfListIO aStoredListIter(aStoredList);
- for(; aStoredListIter.More(); aStoredListIter.Next()){
- if(anIO->isSame(aStoredListIter.Value())){
- aRemoveList.Append(anIO);
- }
- }
- }
- SALOME_ListIteratorOfListIO aRemoveListIter(aRemoveList);
- for(; aRemoveListIter.More(); aRemoveListIter.Next()){
- aSelector->RemoveIObject(aRemoveListIter.Value());
- }
+ QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;
+ SALOME_ListIteratorOfListIO anIt( aStoredList );
+ for( ; anIt.More(); anIt.Next() )
+ if( !anIt.Value().IsNull() )
+ toRemove[ anIt.Value()->getEntry() ] = anIt.Value();
+
+ anIt = SALOME_ListIteratorOfListIO(anAppendList);
+ for( ; anIt.More(); anIt.Next() )
+ toRemove.remove( anIt.Value()->getEntry() );
+
+ QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
+ REnd = toRemove.end();
+ for( ; RIt!=REnd; RIt++ )
+ aSelector->RemoveIObject( RIt.data() );
+
aView->onSelectionChanged();
}
}