mirror of
https://github.com/KDE/konsole.git
synced 2026-05-05 05:07:06 -04:00
Fix accelerator removal for non-Western languages which use "(&Letter)"
to represent accelerators in menu items rather than just '&' in front of one letter.
MainWindow::removeMenuAccelerators()
Use a regexp to match "(&Letters)" as well as '&'
CCBUG: 165949
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=832422
This commit is contained in:
@@ -110,10 +110,14 @@ MainWindow::MainWindow()
|
||||
}
|
||||
void MainWindow::removeMenuAccelerators()
|
||||
{
|
||||
// regular expression to find accelerators in menu items.
|
||||
// Matches the '&' character anywhere in the text (for Western languages)
|
||||
// or " (&Letters)" (for many non-Western languages)
|
||||
static QRegExp acceleratorPattern("\\s\\(\\s*\\&.*\\)|\\&");
|
||||
foreach(QAction* menuItem, menuBar()->actions())
|
||||
{
|
||||
QString itemText = menuItem->text();
|
||||
itemText.remove('&');
|
||||
itemText.remove(acceleratorPattern);
|
||||
menuItem->setText(itemText);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user