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>
This commit is contained in:
Dirk Hohndel 2013-11-07 17:25:42 +09:00
parent f2035bcd79
commit 460aa4c1bd
3 changed files with 15 additions and 2 deletions

View file

@ -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