Mercurial > minori
comparison src/gui/dialog/settings/recognition.cc @ 149:e41505d24733
players: filter out web browsers, they aren't even supported in animia yet
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 14 Nov 2023 13:40:11 -0500 |
parents | 6fdf0632c003 |
children | ffa535b6d630 |
comparison
equal
deleted
inserted
replaced
148:aa4df5a84338 | 149:e41505d24733 |
---|---|
35 } | 35 } |
36 | 36 |
37 { | 37 { |
38 QListWidget* listwidget = new QListWidget(widget); | 38 QListWidget* listwidget = new QListWidget(widget); |
39 for (size_t i = 0; i < players.size(); i++) { | 39 for (size_t i = 0; i < players.size(); i++) { |
40 const auto& player = players[i]; | 40 const auto& [enabled, player] = players[i]; |
41 { | 41 if (player.type == animia::PlayerType::Default) { |
42 QListWidgetItem* item = new QListWidgetItem(listwidget); | 42 QListWidgetItem* item = new QListWidgetItem(listwidget); |
43 item->setCheckState(player.first ? Qt::Checked : Qt::Unchecked); | 43 item->setCheckState(enabled ? Qt::Checked : Qt::Unchecked); |
44 item->setText(Strings::ToQString(player.second.name)); | 44 item->setText(Strings::ToQString(player.name)); |
45 item->setData(Qt::UserRole, QVariant::fromValue(i)); | 45 item->setData(Qt::UserRole, QVariant::fromValue(i)); |
46 } | 46 } |
47 } | 47 } |
48 connect(listwidget, &QListWidget::itemChanged, this, [this](QListWidgetItem* item){ | 48 connect(listwidget, &QListWidget::itemChanged, this, [this](QListWidgetItem* item){ |
49 if (!item) | 49 if (!item) |