Skip to content

Fix delete action switching via 'Shift' when sub-context-menu is open

Derek Christ requested to merge derek/dolphin:context-menu-fix into master

This merge request is an attempt to fix the currently not working switching of the 'Move to Trash' action to 'Delete' using the shift key when the mouse hovers a submenu.

I removed the overwritten key event functions and instead added an event filter. The problem of the current implementation is that the keyPressedEvent() and keyReleasedEvent() functions for some reason don't get called when the shift button is pressed and a sub-menu is visible. However the new eventFilter() does get called in these circuumstances when the filter is installed into the new sub-context-menus. This is done in the childEvent() function.

This fix works for almost all sub-menus. The submenus created by "addPluginActionsTo", which implement 'Tags', 'Activities' and 'Compress' do not work yet.

This fix follows a bit of a hacky approach, so I'm almost sure there is a better way to fix the issue, but we can discuss these better ways here.

Please point out when something in my fix is bad practice, because I'm new to Qt programming.

BUG: 425997

Edited by Méven Car

Merge request reports