diff options
author | Arno <am@disconnect.de> | 2013-04-11 10:09:30 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-04-11 10:09:30 +0200 |
commit | 6d67170284ac0dcf05f7e56ad60ddc2213f5d89c (patch) | |
tree | e61c40cad379f6a0ebe584143b235e07fb736be2 | |
parent | ecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33 (diff) | |
download | SheMov-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...
-rw-r--r-- | mappingtreewidget.cpp | 6 |
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){ |