# HG changeset patch # User Wuzzy # Date 1556572360 -7200 # Node ID 56293aa24e815b7ffd00512cb31f490407f6f068 # Parent 058e204908a61103a9cfe9402f8370aff97be126 Fix crash when pressing key bind reset button in settings diff -r 058e204908a6 -r 56293aa24e81 QTfrontend/ui/page/pageoptions.cpp --- a/QTfrontend/ui/page/pageoptions.cpp Mon Apr 29 22:09:04 2019 +0200 +++ b/QTfrontend/ui/page/pageoptions.cpp Mon Apr 29 23:12:40 2019 +0200 @@ -1240,9 +1240,12 @@ // Returns: The bind model index of the default. int PageOptions::resetBindToDefault(int bindID) { + if (QString(cbinds[bindID].action) == QString("!MULTI")) + return -1; QStandardItemModel * binds = DataManager::instance().bindsModel(); QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, cbinds[bindID].strbind, 1, Qt::MatchExactly); - if(mdl.size() == 1) binder->setBindIndex(bindID, mdl[0].row()); + if(mdl.size() == 1) + binder->setBindIndex(bindID, mdl[0].row()); return mdl[0].row(); } @@ -1251,7 +1254,8 @@ { for (int i = 0; i < BINDS_NUMBER; i++) { - resetBindToDefault(i); - bindUpdated(i); + int ret = resetBindToDefault(i); + if(ret != -1) + bindUpdated(i); } }