options players tab only show now when filled
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6b2b18ed16
commit
2bf6bb5630
1 changed files with 22 additions and 13 deletions
|
@ -136,24 +136,33 @@ OptionsDialog::~OptionsDialog()
|
|||
|
||||
void OptionsDialog::setupTreeWidget()
|
||||
{
|
||||
for (QString playerIDStr : profileDB->getPlayers())
|
||||
const QStringList players = profileDB->getPlayers();
|
||||
if (players.length() != 0) {
|
||||
QStringList::const_iterator it = players.constBegin();
|
||||
QStringList::const_iterator end = players.constEnd();
|
||||
while (it != end)
|
||||
{
|
||||
bool ok;
|
||||
int playerID = playerIDStr.toInt(&ok);
|
||||
int playerID = it->toInt(&ok);
|
||||
if (ok)
|
||||
{
|
||||
QString playerName = profileDB->getPlayerName(playerID);
|
||||
|
||||
QStringList playerTreeViewList;
|
||||
playerTreeViewList += playerIDStr;
|
||||
playerTreeViewList += *it;
|
||||
playerTreeViewList += playerName;
|
||||
|
||||
QTreeWidgetItem *playerItem = new QTreeWidgetItem(playerTreeViewList);
|
||||
ui->twPlayers->addTopLevelItem(playerItem);
|
||||
playerItems += playerItem;
|
||||
}
|
||||
it++;
|
||||
}
|
||||
ui->twPlayers->sortItems(1, Qt::AscendingOrder);
|
||||
}
|
||||
else {
|
||||
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabPlayers));
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsDialog::setupLanguageBox()
|
||||
|
|
Loading…
Reference in a new issue