summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-01 10:18:21 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-01 10:18:21 -0700
commit8bd16a7808d55b8d97c31571de503c23d621c3db (patch)
tree8edca37b79fcabfdfe70ac418deb3ef72de76844 /qt-ui
parent48e059c49dae1919dc38e1ee1e521a75c9e6d30e (diff)
downloadsubsurface-8bd16a7808d55b8d97c31571de503c23d621c3db.tar.gz
Equipment edit: for some reason we need a local copy of index
Calling enableEdition appears to corrupt the index that is passed into this slot. This doesn't fix the problem that we can't edit the cylinder start and end pressure of a manually added dive, but at least we no longer try to edit and invalid index. See #582 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 90a527e3a..e5c2830fc 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1083,14 +1083,16 @@ void MainTab::on_visibility_valueChanged(int value)
void MainTab::editCylinderWidget(const QModelIndex &index)
{
+ // we need a local copy or bad things happen when enableEdition() is called
+ QModelIndex editIndex = index;
if (cylindersModel->changed && editMode == NONE) {
enableEdition();
return;
}
- if (index.isValid() && index.column() != CylindersModel::REMOVE) {
+ if (editIndex.isValid() && editIndex.column() != CylindersModel::REMOVE) {
if (editMode == NONE)
enableEdition();
- ui.cylinders->edit(index);
+ ui.cylinders->edit(editIndex);
}
}