Ignore unknown shortcut names in settings (#5565)

This commit is contained in:
RickyRister 2025-02-05 20:00:31 -08:00 committed by GitHub
parent e6e3333673
commit 12ae7a9eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);