fix for KeyPressMappingSet::restoreFromXml


#1

Hi Jules,

restoreFromXml does not work correctly when there are “unmapping” entries in the xml, for example if the user has exchanged the keypresses associated to two commands.

Replacing:

if (containsMapping (commandId, key)) removeKeyPress (key);
with

for (int i = mappings.size(); --i >= 0;) if (mappings.getUnchecked(i)->commandID == commandId) mappings.getUnchecked(i)->keypresses.removeAllInstancesOf(key);

fixes these issues (an alternative solution would be to store all the ‘unmapping’ entries before the ‘mapping’ entries in the xml)


#2

bump ? the bug is real and the fix is harmless.


#3

Sorry, didn’t see this post. Sure, that makes sense, thanks!