From ffc61e135743a1c7a2f81c1f96d0767fd3560e4f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 12 Feb 2014 05:37:18 -0800 Subject: Don't use current_dive instead of the argument to the function I could have gone either way - the other alternative would have been to remove the argument to the function. But since current_dive is a macro and since the semantic of the function make sense with the argument being passed in, it seemed better to just not use current_dive in the function. Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index f551840ec..435f2bebc 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -417,14 +417,12 @@ void DivePlannerPointsModel::createSimpleDive() void DivePlannerPointsModel::loadFromDive(dive* d) { - /* We need to make a copy, because - * as soon as the model is modified, it will - * remove all samples from the current dive. - * */ - memcpy(&backupDive, current_dive, sizeof(struct dive)); - copy_samples(current_dive, &backupDive); - copy_events(current_dive, &backupDive); - copy_cylinders(current_dive, stagingDive); // this way the correct cylinder data is shown + // We need to make a copy, because as soon as the model is modified, it will + // remove all samples from the dive. + memcpy(&backupDive, d, sizeof(struct dive)); + copy_samples(d, &backupDive); + copy_events(d, &backupDive); + copy_cylinders(d, stagingDive); // this way the correct cylinder data is shown CylindersModel::instance()->setDive(stagingDive); int lasttime = 0; // we start with the first gas and see if it was changed -- cgit v1.2.3-70-g09d2