diff -r 505c8d101be3 -r 089f0c10ca95 QTfrontend/ui/widget/keybinder.cpp --- a/QTfrontend/ui/widget/keybinder.cpp Tue May 07 19:39:08 2019 +0200 +++ b/QTfrontend/ui/widget/keybinder.cpp Tue May 07 20:23:51 2019 +0200 @@ -314,7 +314,6 @@ // check if the given key is bound multiple times bool KeyBinder::checkConflictsWith(int compareTo, bool updateState) { - // TODO: Make conflict check more efficient for(int i=0; isetHidden(false); } - QTableWidgetItem* item = bindComboBoxCellMappings->value(CBBind[i]); - item->setIcon(*conflictIcon); - item->setBackground(QBrush(QColor(0xE3, 0x1A, 0x1A))); - item->setForeground(QBrush(Qt::white)); - item = bindComboBoxCellMappings->value(CBBind[compareTo]); - item->setIcon(*conflictIcon); - item->setBackground(QBrush(QColor(0xE3, 0x1A, 0x1A))); - item->setForeground(QBrush(Qt::white)); + QTableWidgetItem* conflictItem = bindComboBoxCellMappings->value(CBBind[i]); + conflictItem->setIcon(*conflictIcon); + conflictItem->setBackground(QBrush(QColor(0xE3, 0x1A, 0x1A))); + conflictItem->setForeground(QBrush(Qt::white)); + conflictItems.append(conflictItem); + conflictItem = bindComboBoxCellMappings->value(CBBind[compareTo]); + conflictItem->setIcon(*conflictIcon); + conflictItem->setBackground(QBrush(QColor(0xE3, 0x1A, 0x1A))); + conflictItem->setForeground(QBrush(Qt::white)); + conflictItems.append(conflictItem); return true; } - else - { - QTableWidgetItem* item = bindComboBoxCellMappings->value(CBBind[i]); - item->setIcon(*dropDownIcon); - item->setBackground(QBrush(Qt::transparent)); - item->setForeground(QBrush(QColor("#F6CB1C"))); - item = bindComboBoxCellMappings->value(CBBind[compareTo]); - item->setIcon(*dropDownIcon); - item->setBackground(QBrush(Qt::transparent)); - item->setForeground(QBrush(QColor("#F6CB1C"))); - } } if(updateState) { p_hasConflicts = false; conflictLabel->setHidden(true); } + for (int c=0; c < conflictItems.size(); c++) + { + QTableWidgetItem* conflictItem = conflictItems[c]; + conflictItem->setIcon(*dropDownIcon); + conflictItem->setBackground(QBrush(Qt::transparent)); + conflictItem->setForeground(QBrush(QColor("#F6CB1C"))); + conflictItem = NULL; + } + conflictItems.clear(); return false; }