Salome HOME
studyActivated() virtual method has been added
[modules/gui.git] / src / SalomeApp / SalomeApp_SelectionMgr.cxx
index aa23098186c4ad107d7ca53edc58e835697db57e..8c432279c675703b1c5f8e00ba8194bd94450162 100644 (file)
@@ -36,18 +36,23 @@ SalomeApp_Application* SalomeApp_SelectionMgr::application() const
   get all selected objects from selection manager
 
 */
-void SalomeApp_SelectionMgr::selectedObjects( SALOME_ListIO& lst ) const
+void SalomeApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QString& theType ) const
 {
-  lst.Clear();
+  theList.Clear();
 
   SUIT_DataOwnerPtrList aList;
-  selected( aList );
+  selected( aList, theType );
+
+  QMap<QString,int> entryMap;
 
   for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
   {
     const SalomeApp_DataOwner* owner = dynamic_cast<const SalomeApp_DataOwner*>( (*itr).operator->() );
-    if( owner )
-      lst.Append( owner->IO() );
+    if( !owner ) continue;
+    
+    if ( !entryMap.contains(owner->entry()) )
+      theList.Append( owner->IO() );
+    entryMap.insert(owner->entry(), 1);
   }
 }