diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-12 13:34:57 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-12 13:34:57 -0700 |
commit | a4050c2a714861797f3e46d55f3eda1541053387 (patch) | |
tree | ab668fd7220a916f22b6532352d178902d79547c | |
parent | 748198891d380858ef8338fac3279b8eaa13d75a (diff) | |
download | subsurface-a4050c2a714861797f3e46d55f3eda1541053387.tar.gz |
Don't copy the current dive ontop of editedDive after edit has started
If you switch to edit mode by making a change to cylinders or weights,
then the data in the editedDive was changed and afterwards the current
dive was once again copied into the editedDive - even though we already
did that earlier when setting up the display.
Fixes #539
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/maintab.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 5a718ef17..1a30d84e1 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -273,8 +273,8 @@ void MainTab::enableEdition(EditMode newEditMode) } else { displayMessage(tr("This dive is being edited.")); } - // copy the current dive into editedDive and edit that - editedDive = *current_dive; + // editedDive already contains the current dive (we set this up in updateDiveInfo), + // so all we need to do is update the editMode if necessary editMode = newEditMode != NONE ? newEditMode : DIVE; } } @@ -449,6 +449,9 @@ void MainTab::updateDiveInfo(int dive) ui.LocationLabel->setText(tr("Location")); ui.NotesLabel->setText(tr("Notes")); ui.equipmentTab->setEnabled(true); + // now copy the current dive over to editedDive and use THAT to show the + // cylinder and weight model (this way edits on the equipment tab happen in the + // editedDive and not on the real data (until the user hits save) editedDive = *d; cylindersModel->setDive(&editedDive); weightModel->setDive(&editedDive); |