QTfrontend/frameTeam.cpp
changeset 3876 3dd031a8b395
parent 2948 3f21a9dc93d0
child 4976 088d40d8aba2
--- a/QTfrontend/frameTeam.cpp	Sat Sep 18 01:50:29 2010 +0200
+++ b/QTfrontend/frameTeam.cpp	Sat Sep 18 12:35:58 2010 +0200
@@ -35,12 +35,9 @@
     mainLayout.setSpacing(1);
     mainLayout.setContentsMargins(4, 4, 4, 4);
 
-    availableColors.push_back(*color1);
-    availableColors.push_back(*color2);
-    availableColors.push_back(*color3);
-    availableColors.push_back(*color4);
-    availableColors.push_back(*color5);
-    availableColors.push_back(*color6);
+    int i = 0;
+    while(colors[i])
+        availableColors.push_back(*colors[i++]);
 
     resetColors();
 }
@@ -57,7 +54,7 @@
 
 void FrameTeams::resetColors()
 {
-  currentColor=availableColors.begin();
+  currentColor=availableColors.end() - 1; // ensure next color is the first one
 }
 
 QColor FrameTeams::getNextColor() const