Summary: | Crash on removing key bindings | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Albert Astals Cid <aacid> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andresbajotierra, robertknight, spiderbill |
Priority: | NOR | ||
Version: | 2.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Proposed patch |
Description
Albert Astals Cid
2009-02-03 23:11:18 UTC
I can reproduce if I select the two columns of the same row. _ui->keyBindingTable->selectedItems() will return both items, but the deletion process removes the whole row at the end, so when the loop is going to process the second item, its row is gone and it will crash. Possible solutions: - Filter the "_ui->keyBindingTable->selectedItems()" list to only have one item per row. - Do any other check to not access that item if its row does not exist Created attachment 33986 [details]
Proposed patch
Filter the table items to get the unique ones (and column==0)
I also tried filtering the items in the original iteration loop but it caused errors as we were accessing to dead/invalid elements.
I hope indentantion and styles are OK
I can commit the patch if it gets reviewed and approved... Hi Dario, Thanks for the patch - I think it would be simpler just to remove any items from the list returned by selectedItems() which are not in the first column before iterating over each item in the list to remove the rows. Alternatively, iterate through the selected items to create a set of selected rows then iterate through that set to remove the rows. (In reply to comment #4) > Hi Dario, > > Thanks for the patch - I think it would be simpler just to remove any items > from the list returned by selectedItems() which are not in the first column > before iterating over each item in the list to remove the rows. > That could work if you set the selection mode to the whole row. Otherwise, user could select a binding (2° column) and it won't be deleted (as the 1° column is not selected) > Alternatively, iterate through the selected items to create a set of selected > rows then iterate through that set to remove the rows. That is what my patch is doing: creating a new list of unique rows items and then iterate normally. Regards I fixed the issue where clicking will select the entire row in bug 183070. SVN commit 1082422 by hindenburg: Fix crash on removing key bindings. Patch by Dario Andres BUG: 183069 M +16 -2 KeyBindingEditor.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1082422 Thanks for fixing. - Is the fix going to be backported ? Regards *** Bug 227594 has been marked as a duplicate of this bug. *** SVN commit 1095365 by hindenburg: Fix crash on removing key bindings. Patch by Dario Andres CCBUG: 183069 M +16 -2 KeyBindingEditor.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1095365 |