QTfrontend/teamselhelper.cpp
changeset 378 dde4a4a3e0e1
parent 372 4bac77f8cd38
child 379 e4cd3cd209c6
--- a/QTfrontend/teamselhelper.cpp	Thu Feb 01 21:42:11 2007 +0000
+++ b/QTfrontend/teamselhelper.cpp	Fri Feb 02 21:04:36 2007 +0000
@@ -118,7 +118,16 @@
     if(++pOurFrameTeams->currentColor==pOurFrameTeams->availableColors.end()) {
       pOurFrameTeams->currentColor=pOurFrameTeams->availableColors.begin();
     }
-    color=QColor(*pOurFrameTeams->currentColor);
+    color=*pOurFrameTeams->currentColor;
+  } else {
+    // set according color iterator
+    pOurFrameTeams->currentColor=std::find(pOurFrameTeams->availableColors.begin(), 
+					   pOurFrameTeams->availableColors.end(), color);
+    if(pOurFrameTeams->currentColor==pOurFrameTeams->availableColors.end()) {
+      // error condition
+      throw;
+      pOurFrameTeams->currentColor=pOurFrameTeams->availableColors.begin();
+    }
   }
 
   QPalette newPalette = palette();