summaryrefslogtreecommitdiffstats
path: root/mappingtreewidget.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-04-11 10:09:30 +0200
committerArno <am@disconnect.de>2013-04-11 10:09:30 +0200
commit6d67170284ac0dcf05f7e56ad60ddc2213f5d89c (patch)
treee61c40cad379f6a0ebe584143b235e07fb736be2 /mappingtreewidget.cpp
parentecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33 (diff)
downloadSheMov-6d67170284ac0dcf05f7e56ad60ddc2213f5d89c.tar.gz
SheMov-6d67170284ac0dcf05f7e56ad60ddc2213f5d89c.tar.bz2
SheMov-6d67170284ac0dcf05f7e56ad60ddc2213f5d89c.zip
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...
Diffstat (limited to 'mappingtreewidget.cpp')
-rw-r--r--mappingtreewidget.cpp6
1 files changed, 4 insertions, 2 deletions
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<MappingData> &mappings){