summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-28 17:01:18 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-28 17:01:18 -0700
commit412317c91ff5212ea5e53fc4fd12cfdae4c04571 (patch)
tree491add23fd4e771faaabbfb31b1acc9b7bd90f16 /qt-ui/mainwindow.cpp
parent5afabfc9eb0a09539e97b15c24f92290549ccea9 (diff)
downloadsubsurface-412317c91ff5212ea5e53fc4fd12cfdae4c04571.tar.gz
Planner: set up a cylinder, even if no current dive is selected
If there was no current dive we didn't set up any cylinder at all which was a bit awkward as we use AIR but have no cylinder corresponding to it, which breaks assumptions elsewhere. Instead we use either the default cylinder or make one up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 82276f32e..52eb3d115 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -420,10 +420,7 @@ void MainWindow::on_actionDivePlanner_triggered()
DivePlannerPointsModel::instance()->clear();
// setup the staging dive cylinders from the selected dive
- if (current_dive) {
- DivePlannerPointsModel::instance()->copyCylindersFrom(current_dive);
- CylindersModel::instance()->copyFromDive(current_dive);
- }
+ DivePlannerPointsModel::instance()->setupCylinders();
// create a simple starting dive, using the first gas from the just copied cylidners
createFakeDiveForAddAndPlan();