--- a/QTfrontend/ui/widget/frameTeam.cpp Tue May 01 00:22:10 2012 +0200
+++ b/QTfrontend/ui/widget/frameTeam.cpp Tue May 01 11:39:11 2012 +0200
@@ -56,15 +56,16 @@
void FrameTeams::resetColors()
{
- currentColor=availableColors.end() - 1; // ensure next color is the first one
+ currentColor = availableColors.last(); // ensure next color is the first one
}
QColor FrameTeams::getNextColor() const
{
- QList<QColor>::ConstIterator nextColor=currentColor;
- ++nextColor;
- if (nextColor==availableColors.end()) nextColor=availableColors.begin();
- return *nextColor;
+ int idx = availableColors.indexOf(currentColor);
+
+ idx = ++idx % availableColors.size();
+
+ return availableColors.at(idx);
}
void FrameTeams::addTeam(HWTeam team, bool willPlay)