Skip to content

Escape shortcut mnemonic markers (&) in tab texts

Jan Paul Batrina requested to merge work/escape-accelerators-and-html into master

By default (at the least in KDE), & characters in tab names are always used for letter mnemonic shortcuts in accelerators, so we need to escape them to show proper filepaths and suppress the automatic generation of shortcuts.

BUG: 441340

I'm not sure if this will break tab names in platforms where the automatic accelerators are disabled (every & will be doubled). Calling qt_set_sequence_auto_mnemonic(false) doesn't show any problems, but I'm not sure if that actually simulates a platform where accelerators are disabled. Looking at qtabbar.cpp, it seems that Qt::TextShowMnemonic is hardcoded, so this patch will probably not break tab names on such platforms.

The 2nd commit fixes a similar issue in the search plugin as toHmlEscaped() was not called for some of the filepaths.

Before(Left) and After(Right) screenshot:

kate-escaped-strings

Edited by Christoph Cullmann

Merge request reports