summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-19 21:13:09 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-19 21:18:26 -0500
commit1894bdd3cbafdbc5e80fdd36e3e667851e48f91a (patch)
tree2da16fc5acf59bf259de1a99acbb4398fe021971
parent5b0f4e79c4767f6d4e305e1607d7749330531a21 (diff)
downloadsubsurface-1894bdd3cbafdbc5e80fdd36e3e667851e48f91a.tar.gz
Don't trigger creation of dive from invalid plan in planCreated()
This is subtle. The modifications to the selection cause a redraw of the profile. So we need to make sure that we leave the plan state and return to profile state BEFORE we do this, otherwise we'll call into createTemporaryPlan() with invalid data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/mainwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 401c114f8..c8461aee8 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -407,6 +407,7 @@ void MainWindow::planCanceled()
void MainWindow::planCreated()
{
// get the new dive selected and assign a number if reasonable
+ ui.newProfile->setProfileState();
if (displayed_dive.id == 0) {
// we might have added a new dive (so displayed_dive was cleared out by clone_dive()
dive_list()->unselectDives();