Mercurial > minori
comparison src/gui/dialog/settings/recognition.cc @ 150:ffa535b6d630
*: avoid usage of std::[pair,tuple]
https://arne-mertz.de/2017/03/smelly-pair-tuple/
it's better to use real structures and such where variables are easily known...
also apparently using [] on structs is actually valid? I had no idea.
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Tue, 14 Nov 2023 16:27:33 -0500 |
| parents | e41505d24733 |
| children | ff0061e75f0f |
comparison
equal
deleted
inserted
replaced
| 149:e41505d24733 | 150:ffa535b6d630 |
|---|---|
| 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) |
| 50 return; | 50 return; |
| 51 size_t i = item->data(Qt::UserRole).toUInt(); | 51 size_t i = item->data(Qt::UserRole).toUInt(); |
| 52 players[i].first = item->checkState(); | 52 players[i].enabled = item->checkState(); |
| 53 }); | 53 }); |
| 54 /* this is down here because the listwidget state depends on it */ | 54 /* this is down here because the listwidget state depends on it */ |
| 55 connect(checkbox, &QCheckBox::stateChanged, this, [this, listwidget](int state) { | 55 connect(checkbox, &QCheckBox::stateChanged, this, [this, listwidget](int state) { |
| 56 detect_media_players = (state == Qt::Checked); | 56 detect_media_players = (state == Qt::Checked); |
| 57 listwidget->setEnabled(detect_media_players); | 57 listwidget->setEnabled(detect_media_players); |
