Commit c6a8b2f5 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Global Shortcuts KCM] Also check PortableText

Allows to find keyboard shortcuts without knowing the localized key designation.

Differential Revision: https://phabricator.kde.org/D29475
parent 16767a2c
......@@ -48,14 +48,16 @@ bool FilteredShortcutsModel::filterAcceptsRow(int source_row, const QModelIndex
const auto &defaultShortcuts = index.data(ShortcutsModel::DefaultShortcutsRole).value<QSet<QKeySequence>>();
for (const auto& shortcut : defaultShortcuts) {
if (shortcut.toString(QKeySequence::NativeText).contains(m_filter, Qt::CaseInsensitive)) {
if (shortcut.toString(QKeySequence::NativeText).contains(m_filter, Qt::CaseInsensitive)
|| shortcut.toString(QKeySequence::PortableText).contains(m_filter, Qt::CaseInsensitive)) {
return true;
}
}
const auto &shortcuts = index.data(ShortcutsModel::CustomShortcutsRole).value<QSet<QKeySequence>>();
for (const auto& shortcut : shortcuts) {
if (shortcut.toString(QKeySequence::NativeText).contains(m_filter, Qt::CaseInsensitive)) {
if (shortcut.toString(QKeySequence::NativeText).contains(m_filter, Qt::CaseInsensitive)
|| shortcut.toString(QKeySequence::PortableText).contains(m_filter, Qt::CaseInsensitive)) {
return true;
}
}
......
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