hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.07k stars 172 forks source link

MainForm: fix redo after shortcut modification #2055

Closed theGreatWhiteShark closed 1 month ago

theGreatWhiteShark commented 1 month ago

This led to segfaults on master when setting a shortcut in the PreferencesDialog and triggering anything which can be undone afterwards.

Since changing the Preferences triggers MainForm::createMenuBar - to update the shown shortcuts - we have to be very careful to enabling/disabling the proper undo/redo actions based on the current stack position.

Also, it is important to only connect these once. Else the property will be set over and over again.