Fix removing multiple system keys shortcuts.

Whenever users try to remove the system keys shortcuts, the
configuration file is overwritten and only records the last erase.

For example, if we wish to remove all the auto{A,B,L,R} keys at once,
we get the following writes on the configuration file:

NOOP=ALT+1,ALT+2,ALT+3,ALT+4
NOOP=ALT+2,ALT+3,ALT+4
NOOP=ALT+3,ALT+4
NOOP=ALT+4

Only `NOOP=ALT+4` stays for the following execution.
This commit is contained in:
Edênis Freindorfer Azevedo 2019-06-10 21:40:41 -03:00 committed by Rafael Kitover
parent 996d5b9df8
commit d655031a8f
1 changed files with 3 additions and 1 deletions

View File

@ -762,9 +762,11 @@ void update_opts()
if (gopts.accels.size())
cfg->SetPath(wxT("/Keyboard"));
int cmd_id = -1;
for (wxAcceleratorEntry_v::iterator i = gopts.accels.begin();
i < gopts.accels.end(); ++i) {
int cmd_id = i->GetCommand();
if (cmd_id == i->GetCommand()) continue;
cmd_id = i->GetCommand();
int cmd;
for (cmd = 0; cmd < ncmds; cmd++)