aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-07 17:25:42 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-07 18:07:10 +0900
commit460aa4c1bdee64f25e1c846ac9a6182e4e8e9820 (patch)
tree0e651be7983f0728dff52c963448dd5ac7982b58 /qt-ui/diveplanner.cpp
parentf2035bcd797cab0b6be180b160bca3e768ccb652 (diff)
downloadsubsurface-460aa4c1bdee64f25e1c846ac9a6182e4e8e9820.tar.gz
Include the cylinder information in a dive added with "Add Dive"
We only copied the samples, but not the related cylinder data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 169158987..39db8f431 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -437,6 +437,7 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
}
Q_FOREACH(const sample &s, backupSamples){
+ // we need to use the correct gas
plannerModel->addStop(s.depth.mm, s.time.seconds, tr("Air"), 0);
}
}
@@ -1190,8 +1191,10 @@ void DivePlannerPointsModel::createTemporaryPlan()
tempDive = NULL;
const char *errorString = NULL;
plan(&diveplan, &cache, &tempDive, isPlanner(), &errorString);
- if (mode == ADD)
+ if (mode == ADD) {
copy_samples(tempDive, current_dive);
+ copy_cylinders(tempDive, current_dive);
+ }
#if DEBUG_PLAN
dump_plan(&diveplan);
#endif