mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
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:
parent
3d47bdf22c
commit
a619ca0872
1 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue