From 6d67170284ac0dcf05f7e56ad60ddc2213f5d89c Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 11 Apr 2013 10:09:30 +0200 Subject: Possible Bugfix in MappingEditWidget SheMov crashed in MappingEditWidget::removeMapping, maybe because of some race. So turn the selected QModelIndex into a PersistentModelIndex and check for validity before removing the row... --- mappingtreewidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mappingtreewidget.cpp') diff --git a/mappingtreewidget.cpp b/mappingtreewidget.cpp index 39bece7..8522f8b 100644 --- a/mappingtreewidget.cpp +++ b/mappingtreewidget.cpp @@ -310,8 +310,10 @@ void MappingEditWidget::removeMapping(){ if(sel.isEmpty()){ return; } - QModelIndex firstIdx = sel.first(); - mResultModel->removeRows(firstIdx.row(), 1, firstIdx.parent()); + QPersistentModelIndex firstIdx = sel.first(); + if(firstIdx.isValid()){ + mResultModel->removeRows(firstIdx.row(), 1, firstIdx.parent()); + } } void MappingEditWidget::setMappings(const QList &mappings){ -- cgit v1.2.3-70-g09d2