]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
ObjListBox // small corrections
authorisn <isn@opencascade.com>
Fri, 19 Jun 2015 08:16:52 +0000 (11:16 +0300)
committerisn <isn@opencascade.com>
Fri, 19 Jun 2015 08:16:52 +0000 (11:16 +0300)
src/HYDROGUI/HYDROGUI_ObjListBox.cxx

index f20715a645dc821e748bbf359ea14fe14f745ccb..3eef3832255dc72971ce6af02c3006751988d8e6 100644 (file)
@@ -121,11 +121,7 @@ void HYDROGUI_ObjListBox::OnExclude()
 {
   QList<QListWidgetItem*> aSelection = myList->selectedItems();
   foreach( QListWidgetItem* anItem, aSelection )
-  {
-    int anIndex = myList->row( anItem );
-    myList->takeItem( anIndex );
-    mySelection.Remove( anIndex, anIndex );
-  }
+    delete anItem;
 }
 
 void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects )
@@ -140,8 +136,11 @@ void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects
     if( isOK )
     {
       QString aName = anObject->GetName();
-      myList->addItem( aName );
-      mySelection.Append( anObject );
+      if (myList->findItems(aName, Qt::MatchExactly).size() == 0)
+      {
+        myList->addItem( aName );
+        mySelection.Append( anObject );
+      }
     }
   }
 }