Commit dd0b3d85 authored by David Faure's avatar David Faure
Browse files

Optimize KShortcutsEditorItem::keySequence using two lambdas

No point in calling KGlobalAccel API if we're not going to use it.
parent 3e22519f
......@@ -164,21 +164,22 @@ bool KShortcutsEditorItem::operator<(const QTreeWidgetItem &other) const
QKeySequence KShortcutsEditorItem::keySequence(uint column) const
QList<QKeySequence> shortcuts = m_action->shortcuts();
auto shortcuts = [this]() { return m_action->shortcuts(); };
QList<QKeySequence> globalShortcuts = KGlobalAccel::self()->shortcut(m_action);
auto globalShortcuts = [this]() { return KGlobalAccel::self()->shortcut(m_action); };
switch (column) {
case LocalPrimary:
return primarySequence(shortcuts);
return primarySequence(shortcuts());
case LocalAlternate:
return alternateSequence(shortcuts);
return alternateSequence(shortcuts());
case GlobalPrimary:
return primarySequence(globalShortcuts);
return primarySequence(globalShortcuts());
case GlobalAlternate:
return alternateSequence(globalShortcuts);
return alternateSequence(globalShortcuts());
return QKeySequence();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment