mirror of
https://github.com/KDE/konsole.git
synced 2026-05-04 04:33:38 -04:00
Prefer foreach(..) over iterating manually for readability
This commit is contained in:
@@ -70,13 +70,9 @@ KeyBindingEditor::~KeyBindingEditor()
|
||||
|
||||
void KeyBindingEditor::removeSelectedEntry()
|
||||
{
|
||||
QList<QTableWidgetItem*> selectedList = _ui->keyBindingTable->selectedItems();
|
||||
QList<QTableWidgetItem*> uniqueList;
|
||||
|
||||
//Filter unique items
|
||||
QListIterator<QTableWidgetItem*> iter(selectedList);
|
||||
while (iter.hasNext()) {
|
||||
QTableWidgetItem* item = iter.next();
|
||||
foreach ( QTableWidgetItem* item, _ui->keyBindingTable->selectedItems() ) {
|
||||
if (item->column() == 1) //Select item at the first column
|
||||
item = _ui->keyBindingTable->item(item->row(), 0);
|
||||
|
||||
@@ -84,10 +80,8 @@ void KeyBindingEditor::removeSelectedEntry()
|
||||
uniqueList.append(item);
|
||||
}
|
||||
|
||||
iter = QListIterator<QTableWidgetItem*>(uniqueList);
|
||||
while (iter.hasNext()) {
|
||||
foreach ( QTableWidgetItem* item, uniqueList ) {
|
||||
// get the first item in the row which has the entry
|
||||
QTableWidgetItem* item = iter.next();
|
||||
|
||||
KeyboardTranslator::Entry existing = item->data(Qt::UserRole).
|
||||
value<KeyboardTranslator::Entry>();
|
||||
|
||||
Reference in New Issue
Block a user