diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-14 16:31:48 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-03-29 00:04:49 +0200 |
commit | 606430682b36516b58a7322a831b2d3a3cf22ade (patch) | |
tree | f17e6dbf03a71d938eabdf3dd42a2c83fd41d29b | |
parent | e1e6e579613dc4b6d3fbd4543996c24626b9815e (diff) |
tracker/trackhat: use tuple for constant initializer
-rw-r--r-- | tracker-trackhat/dialog.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tracker-trackhat/dialog.cpp b/tracker-trackhat/dialog.cpp index b4ee945e..1607eb1e 100644 --- a/tracker-trackhat/dialog.cpp +++ b/tracker-trackhat/dialog.cpp @@ -8,22 +8,19 @@ trackhat_dialog::trackhat_dialog() poll_tracker_info(); poll_timer.setInterval(250); - struct { - const char* name; - model_type t; - } model_types[] = { - { "Cap", model_cap }, - { "Clip (left)", model_clip_left }, - { "Clip (right)", model_clip_right }, - { "Mini Clip (left)", model_mini_clip_left }, - { "Mini Clip (right)", model_mini_clip_right }, - { "Mystery Meat", model_mystery_meat }, + const std::tuple<QString, model_type> model_types[] = { + { "Cap", model_cap }, + { "Clip (left)", model_clip_left }, + { "Clip (right)", model_clip_right }, + { "Mini Clip (left)", model_mini_clip_left }, + { "Mini Clip (right)", model_mini_clip_right }, + { "Custom", model_mystery_meat }, }; ui.model_type->clear(); - for (auto x : model_types) - ui.model_type->addItem(QIcon{}, tr(x.name), (QVariant)(int)x.t); + for (const auto& [name, type] : model_types) + ui.model_type->addItem(QIcon{}, name, (QVariant)(int)type); // model |