equal
deleted
inserted
replaced
437 (*it)->setCurrentIndex(pos); |
437 (*it)->setCurrentIndex(pos); |
438 } |
438 } |
439 } |
439 } |
440 } |
440 } |
441 |
441 |
442 void HWForm::UpdateTeamsLists(const QStringList* editable_teams) |
442 void HWForm::UpdateTeamsLists() |
443 { |
443 { |
444 QStringList teamslist; |
444 QStringList teamslist = config->GetTeamsList(); |
445 if(editable_teams) |
|
446 { |
|
447 teamslist =* editable_teams; |
|
448 } |
|
449 else |
|
450 { |
|
451 teamslist = config->GetTeamsList(); |
|
452 } |
|
453 |
445 |
454 if(teamslist.empty()) |
446 if(teamslist.empty()) |
455 { |
447 { |
456 QString currentNickName = gameSettings->value("net/nick","").toString().toUtf8(); |
448 QString currentNickName = gameSettings->value("net/nick","").toString().toUtf8(); |
457 QString teamName; |
449 QString teamName; |
458 if (currentNickName == "") |
450 |
|
451 if (currentNickName.isEmpty()) |
459 { |
452 { |
460 teamName = tr("DefaultTeam"); |
453 teamName = tr("DefaultTeam"); |
461 } |
454 } |
462 else |
455 else |
463 { |
456 { |
464 teamName = tr("%1's Team").arg(currentNickName); |
457 teamName = tr("%1's Team").arg(currentNickName); |
465 } |
458 } |
|
459 |
466 HWTeam defaultTeam(teamName); |
460 HWTeam defaultTeam(teamName); |
467 defaultTeam.saveToFile(); |
461 defaultTeam.saveToFile(); |
468 teamslist.push_back(teamName); |
462 teamslist.push_back(teamName); |
469 } |
463 } |
470 |
464 |