mirror of
https://github.com/KDE/konsole.git
synced 2026-06-11 23:45:09 -04:00
Port away from deprecated foreach, use for-range instead, first take
The code compiles and konsole loads and seems to work as before.
This commit is contained in:
@@ -123,8 +123,8 @@ void KeyBindingEditor::filterRows(const QString &text)
|
||||
void KeyBindingEditor::removeSelectedEntry()
|
||||
{
|
||||
QList<QTableWidgetItem *> uniqueList;
|
||||
|
||||
foreach (QTableWidgetItem *item, _ui->keyBindingTable->selectedItems()) {
|
||||
const QList<QTableWidgetItem *> selectedItems = _ui->keyBindingTable->selectedItems();
|
||||
for (QTableWidgetItem *item : selectedItems) {
|
||||
if (item->column() == 1) { //Select item at the first column
|
||||
item = _ui->keyBindingTable->item(item->row(), 0);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ void KeyBindingEditor::removeSelectedEntry()
|
||||
}
|
||||
}
|
||||
|
||||
foreach (QTableWidgetItem *item, uniqueList) {
|
||||
for (QTableWidgetItem *item : qAsConst(uniqueList)) {
|
||||
// get the first item in the row which has the entry
|
||||
|
||||
KeyboardTranslator::Entry existing = item->data(Qt::UserRole).
|
||||
|
||||
Reference in New Issue
Block a user