Git commit c2be24a66d47add15143d3df72fc60964d0ccab2 by Valeriy Malov. Committed on 20/09/2018 at 16:26. Pushed by valeriymalov into branch 'master'. Fix reading of button mapping in tabletfinder Use of replace could overwrite previously inserted values M +5 -7 src/tabletfinder/dialog.cpp https://commits.kde.org/wacomtablet/c2be24a66d47add15143d3df72fc60964d0ccab2 diff --git a/src/tabletfinder/dialog.cpp b/src/tabletfinder/dialog.cpp index 5c4014a..75fe7e4 100644 --- a/src/tabletfinder/dialog.cpp +++ b/src/tabletfinder/dialog.cpp @@ -193,13 +193,11 @@ void Dialog::refreshTabletList() t.hwMapping << i; } = - QMapIterator i(ti.getButtonMap()); - while (i.hasNext()) { - i.next(); - int b =3D i.key().toInt(); - int k =3D i.value().toInt(); - if(b < t.hwMapping.size()) { - t.hwMapping.replace(b-1,k); + const auto buttonMap =3D ti.getButtonMap(); + for (const auto key : buttonMap.keys()) { + const auto keyIndex =3D key.toInt() - 1; + if (keyIndex < t.buttonNumber) { + t.hwMapping[keyIndex] =3D buttonMap.value(key).toInt(); } } =20