119 } |
119 } |
120 |
120 |
121 void TeamSelWidget::removeNetTeam(const HWTeam& team) |
121 void TeamSelWidget::removeNetTeam(const HWTeam& team) |
122 { |
122 { |
123 //qDebug() << QString("removeNetTeam: removing team '%1'").arg(team.TeamName); |
123 //qDebug() << QString("removeNetTeam: removing team '%1'").arg(team.TeamName); |
124 for(;;) |
124 QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
125 { |
125 if(itPlay==curPlayingTeams.end()) |
126 QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
126 { |
127 if(itPlay==curPlayingTeams.end()) |
127 qWarning() << QString("removeNetTeam: team '%1' not found").arg(team.name()); |
128 { |
128 return; |
129 qWarning() << QString("removeNetTeam: team '%1' not found").arg(team.name()); |
129 } |
130 break; |
130 |
131 } |
131 if(itPlay->isNetTeam()) |
132 if(itPlay->isNetTeam()) |
132 { |
133 { |
133 QObject::disconnect(framePlaying->getTeamWidget(*itPlay), SIGNAL(teamStatusChanged(HWTeam))); |
134 QObject::disconnect(framePlaying->getTeamWidget(*itPlay), SIGNAL(teamStatusChanged(HWTeam))); |
134 framePlaying->removeTeam(team); |
135 framePlaying->removeTeam(team); |
135 curPlayingTeams.erase(itPlay); |
136 curPlayingTeams.erase(itPlay); |
136 } |
137 break; |
137 else |
138 } |
138 { |
139 else |
139 qWarning() << QString("removeNetTeam: team '%1' was actually a local team!").arg(team.name()); |
140 { |
|
141 qWarning() << QString("removeNetTeam: team '%1' was actually a local team!").arg(team.name()); |
|
142 break; |
|
143 } |
|
144 } |
140 } |
145 emit setEnabledGameStart(curPlayingTeams.size()>1); |
141 emit setEnabledGameStart(curPlayingTeams.size()>1); |
146 } |
142 } |
147 |
143 |
148 void TeamSelWidget::changeTeamStatus(HWTeam team) |
144 void TeamSelWidget::changeTeamStatus(HWTeam team) |