Fix #22515: Shortcuts for search string icons on toolbar made with Search tool are not working
This happens due to the hashCode implementation in Enum (final int hashCode
), as
it uses the default Object#hashCode
implementation. This is stable inside the same
JVM instance, but will usually not be the same after a JVM restart.
Since the hashCode is used to find the preference value, it must be stable across
JVM restarts. To fix this problem, we just use the code char from the mode.