yuzu: Fix restore shortcuts button

This commit is contained in:
Narr the Reg
2023-10-21 10:45:10 -06:00
committed by german77
parent 2e760a9833
commit 77fb9d415b
3 changed files with 10 additions and 2 deletions

View File

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