Fix missing setDefaultShortcuts call

Summary:
The commit eec49bc38f cased a warning to
be emitted when starting Dolphin:

KXMLGUIFactoryPrivate::saveDefaultActionProperties(): Shortcut for action  "go_forward" "&Forward" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.

The fix is to call
actionCollection()->setDefaultShortcuts(m_forwardAction, m_forwardAction->shortcuts());
so that the default shortcuts are setup.

Reviewers: elvisangelaccio

Reviewed By: elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D24342
This commit is contained in:
David Hallas 2019-10-01 17:24:53 +02:00
parent 43ea7052e1
commit c71c1c94be

View file

@ -1427,6 +1427,8 @@ void DolphinMainWindow::setupActions()
connect(m_forwardAction->menu(), &QMenu::aboutToShow, this, &DolphinMainWindow::slotAboutToShowForwardPopupMenu);
connect(m_forwardAction->menu(), &QMenu::triggered, this, &DolphinMainWindow::slotGoForward);
actionCollection()->addAction(m_forwardAction->objectName(), m_forwardAction);
actionCollection()->setDefaultShortcuts(m_forwardAction, m_forwardAction->shortcuts());
// enable middle-click to open in a new tab
auto *middleClickEventFilter = new MiddleClickActionEventFilter(this);
connect(middleClickEventFilter, &MiddleClickActionEventFilter::actionMiddleClicked, this, &DolphinMainWindow::slotBackForwardActionMiddleClicked);