diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-10-21 10:45:10 -0600 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-10-21 21:16:20 -0600 |
commit | 77fb9d415b2dde43dcd1142afaa6dc293734fc0e (patch) | |
tree | bd499db5c13081f6ef25fd6e8fe6f6804c6abe65 /src/yuzu/configuration/configure_hotkeys.cpp | |
parent | 2e760a98333520f3de1fa7c7a1f9298fd7241ceb (diff) |
yuzu: Fix restore shortcuts button
Diffstat (limited to 'src/yuzu/configuration/configure_hotkeys.cpp')
-rw-r--r-- | src/yuzu/configuration/configure_hotkeys.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp index 0b2a965f8..68e21cd84 100644 --- a/src/yuzu/configuration/configure_hotkeys.cpp +++ b/src/yuzu/configuration/configure_hotkeys.cpp @@ -319,6 +319,13 @@ void ConfigureHotkeys::ApplyConfiguration(HotkeyRegistry& registry) { void ConfigureHotkeys::RestoreDefaults() { for (int r = 0; r < model->rowCount(); ++r) { const QStandardItem* parent = model->item(r, 0); + const int hotkey_size = static_cast<int>(Config::default_hotkeys.size()); + + if (hotkey_size != parent->rowCount()) { + QMessageBox::warning(this, tr("Invalid hotkey settings"), + tr("An error occurred. Please report this issue on github.")); + return; + } for (int r2 = 0; r2 < parent->rowCount(); ++r2) { model->item(r, 0) |