Changed a tab's KMenu to have it's accelerators managed automatically.

svn path=/trunk/KDE/kdebase/apps/; revision=938417
This commit is contained in:
Shaun Reich 2009-03-11 20:31:09 +00:00
parent 3d47bdf22c
commit a619ca0872

View file

@ -843,17 +843,17 @@ void DolphinMainWindow::closeTab(int index)
void DolphinMainWindow::openTabContextMenu(int index, const QPoint& pos)
{
KMenu menu(this);
KMenu* menu = new KMenu(this);
QAction* newTabAction = menu.addAction(KIcon("tab-new"), i18nc("@action:inmenu", "New Tab"));
QAction* newTabAction = menu->addAction(KIcon("tab-new"), i18nc("@action:inmenu", "New Tab"));
newTabAction->setShortcut(actionCollection()->action("new_tab")->shortcut());
QAction* closeOtherTabsAction = menu.addAction(KIcon("tab-close-other"), i18nc("@action:inmenu", "Close Other Tabs"));
QAction* closeOtherTabsAction = menu->addAction(KIcon("tab-close-other"), i18nc("@action:inmenu", "Close Other Tabs"));
QAction* closeTabAction = menu.addAction(KIcon("tab-close"), i18nc("@action:inmenu", "Close Tab"));
QAction* closeTabAction = menu->addAction(KIcon("tab-close"), i18nc("@action:inmenu", "Close Tab"));
closeTabAction->setShortcut(actionCollection()->action("close_tab")->shortcut());
QAction* selectedAction = menu.exec(pos);
KAcceleratorManager::manage(menu);
QAction* selectedAction = menu->exec(pos);
if (selectedAction == newTabAction) {
const ViewTab& tab = m_viewTab[index];
Q_ASSERT(tab.primaryView != 0);