[kde-china] 剔除 konsole 主菜单栏快捷键翻译

Liang Qi cavendish.qi在gmail.com
星期一 七月 7 16:33:36 CEST 2008


看了一下log,够狠

------- Additional Comment #11 From Robert Knight 2008-06-27 23:18 -------
SVN commit 825353 by knight:

Remove accelerators from top-level menu items to avoid conflicting
with Alt+Letter shortcuts in the terminal.

* Use KAcceleratorManager::setNoAccel() to avoid generating
accelerators for non-standard top-level items.
* Strip ampersand characters from the text of standard top-level
menu items (File, Edit, View, Settings, Help) which have accelerators
defined in ui_standards.rc after creating the menus with XMLGUI

BUG: 162209


 M  +23 -3     MainWindow.cpp
 M  +1 -0      MainWindow.h


WebSVN link: http://websvn.kde.org/?view=rev&revision=825353

http://websvn.kde.org/trunk/KDE/kdebase/apps/konsole/src/MainWindow.cpp?r1=803112&r2=825353&pathrev=825353

void MainWindow::removeMenuAccelerators()
{
    foreach(QAction* menuItem, menuBar()->actions())
    {
        QString itemText = menuItem->text();
        itemText.remove('&');
        menuItem->setText(itemText);
    }
}

但是这个字符串因为是用于Action的字符串,应该是同时用在菜单(Menu)和工具栏(ToolBar)中的,所以不能简单地删除。

需要另外提bug给konsole开发人员。

太简单粗暴了。

齐亮


关于邮件列表 kde-china 的更多信息