QTfrontend/teamselect.cpp
changeset 132 2d0f404cdf05
parent 131 482f78c595ec
child 140 50ccde437ea1
--- a/QTfrontend/teamselect.cpp	Mon Aug 28 19:02:57 2006 +0000
+++ b/QTfrontend/teamselect.cpp	Sun Sep 03 12:56:13 2006 +0000
@@ -11,7 +11,7 @@
 
 void TeamSelWidget::addTeam(HWTeam team)
 {
-  frameDontPlaying->addTeam(team);
+  frameDontPlaying->addTeam(team, false);
   curDontPlayingTeams.push_back(team);
   QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
 		   this, SLOT(changeTeamStatus(HWTeam)));
@@ -27,7 +27,9 @@
   list<HWTeam>::iterator itDontPlay=std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team);
   list<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
 
-  if(itDontPlay==curDontPlayingTeams.end()) {
+  bool willBePlaying=itDontPlay!=curDontPlayingTeams.end();
+
+  if(!willBePlaying) {
     // playing team => dont playing
     curDontPlayingTeams.push_back(*itPlay);
     curPlayingTeams.erase(itPlay);
@@ -39,7 +41,7 @@
 
   FrameTeams* pRemoveTeams;
   FrameTeams* pAddTeams;
-  if(itDontPlay==curDontPlayingTeams.end()) {
+  if(!willBePlaying) {
     pRemoveTeams=framePlaying;
     pAddTeams=frameDontPlaying;
   } else {
@@ -47,7 +49,7 @@
     pAddTeams=framePlaying;
   }
 
-  pAddTeams->addTeam(team);
+  pAddTeams->addTeam(team, willBePlaying);
   pRemoveTeams->removeTeam(team);
   QObject::connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
 		   this, SLOT(changeTeamStatus(HWTeam)));