Commit b4afdc95 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Fix crash on removing key bindings. Patch by Dario Andres

BUG: 183069

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1082422
parent 1cf6ef93
......@@ -71,12 +71,26 @@ KeyBindingEditor::~KeyBindingEditor()
void KeyBindingEditor::removeSelectedEntry()
{
QListIterator<QTableWidgetItem*> iter( _ui->keyBindingTable->selectedItems() );
QList<QTableWidgetItem*> selectedList = _ui->keyBindingTable->selectedItems();
QList<QTableWidgetItem*> uniqueList;
//Filter unique items
QListIterator<QTableWidgetItem*> iter( selectedList );
while ( iter.hasNext() )
{
QTableWidgetItem* item = iter.next();
if (item->column() == 1) //Select item at the first column
item = _ui->keyBindingTable->item(item->row(),0);
if ( !uniqueList.contains(item) )
uniqueList.append(item);
}
iter = QListIterator<QTableWidgetItem*>( uniqueList );
while ( iter.hasNext() )
{
// get the first item in the row which has the entry
QTableWidgetItem* item = _ui->keyBindingTable->item(iter.next()->row(),0);
QTableWidgetItem* item = iter.next();
KeyboardTranslator::Entry existing = item->data(Qt::UserRole).
value<KeyboardTranslator::Entry>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment