Fix shortcut comparison not working for some key combinations.

This commit is contained in:
Leonardo Zide
2026-07-16 22:29:50 -07:00
parent 9dd9208067
commit dfc7341ab7
+3 -1
View File
@@ -1121,7 +1121,9 @@ void lcPreferencesDialog::ShortcutAssignClicked()
{ {
for (uint ExistingIndex = 0; ExistingIndex < LC_ARRAY_COUNT(Shortcuts); ExistingIndex++) for (uint ExistingIndex = 0; ExistingIndex < LC_ARRAY_COUNT(Shortcuts); ExistingIndex++)
{ {
if (NewShortcut == Shortcuts[ExistingIndex] && ExistingIndex != ShortcutIndex) QKeySequence Sequence(Shortcuts[ExistingIndex]);
if (NewShortcut == Sequence.toString(QKeySequence::NativeText) && ExistingIndex != ShortcutIndex)
{ {
QString ActionText = qApp->translate("Menu", gCommands[ExistingIndex].MenuName).remove('&').remove(QLatin1String("...")); QString ActionText = qApp->translate("Menu", gCommands[ExistingIndex].MenuName).remove('&').remove(QLatin1String("..."));
QString QuestionText = tr("The shortcut '%1' is already assigned to '%2'. Do you want to replace it?").arg(NewShortcut, ActionText); QString QuestionText = tr("The shortcut '%1' is already assigned to '%2'. Do you want to replace it?").arg(NewShortcut, ActionText);