Ignore unknown shortcut names in settings (#5565)

This commit is contained in:
RickyRister
2025-02-06 04:00:31 +00:00
committed by GitHub
parent e6e3333673
commit 12ae7a9eeb
@@ -28,6 +28,13 @@ ShortcutsSettings::ShortcutsSettings(const QString &settingsPath, QObject *paren
QMap<QString, QString> invalidItems;
for (QStringList::const_iterator it = customKeys.constBegin(); it != customKeys.constEnd(); ++it) {
QString stringSequence = shortCutsFile.value(*it).toString();
// check whether shortcut name exists
if (!shortCuts.contains(*it)) {
qCWarning(ShortcutsSettingsLog) << "Unknown shortcut name:" << *it;
continue;
}
// check whether shortcut is forbidden
if (isKeyAllowed(*it, stringSequence)) {
auto shortcut = getShortcut(*it);