Bug 775931 - Shortcut for non-existing action shadows existing one.
Current logics of dealing with duplicate accelerators was just to delete one randomly. This works ok in most case since we can't be in the head of people and can't know which one they want to keep (yet we can't keep both because that makes it very complicated to reset the shortcut appropriately by hand/GUI, without a tedious work of researching which other action uses the same shortcut. See commit 2a232398). There is still some cases where we can be a bit more clever than random deletion: when one of the accelerator is mapped to a non-existing action. In this case, let's delete this accelerator in priority. Not only the chances of this being the expected result are higher; but even worse, there is anyway no GUI way to delete the accelerator for the non-existing action! Thus you could try and reset your existing action's shortcut as many times as you want in the GUI, it would always end up deleted at next startup! Note that if the non-existing action's shortcut has no duplicate, it won't be deleted. This ensure that you could uninstall a plugin, then reinstall it later and still have your custom shortcuts saved in the meantime. A shortcut of a non-existing action will *only* be cleaned out if it is redundant with the shortcut of an existing action.