You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Reworked legacy position population
- Changed data structure to a static list of pairs to avoid unnecessary deep copies
- Fixed oversight which caused iteration over the value and not the key of the previous QMap
* clang-format pass :rolling_eyes:
* disambiguate pair order further
// Populate the dropdown list with all pos that exist on this bg
1410
1402
QStringList pos_list = {};
1411
-
for (const QString &key : std::as_const(default_pos))
1403
+
for (constQPair<QString, QString> &pos_pair : std::as_const(legacy_positions))
1412
1404
{
1413
-
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path(default_pos[key]))) || // if we have 2.8-style positions, e.g. def.png, wit.webp, hld.apng
{// if we have pre-2.8-style positions, e.g. defenseempty.png
1416
-
pos_list.append(default_pos[key]);
1405
+
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path(pos_pair.first))) || // if we have 2.8-style positions, e.g. def.png, wit.webp, hld.apng
1406
+
file_exists(ao_app->get_image_suffix(ao_app->get_background_path(pos_pair.second))))// if we have pre-2.8-style positions, e.g. defenseempty.png
1407
+
{
1408
+
pos_list.append(pos_pair.first); // the dropdown always uses the new style
1417
1409
}
1418
1410
}
1419
1411
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("court"))))
0 commit comments