Be consistent when passing around gas data in the planner

We need to make sure that the correct segment has the correct gas assigned
to it - and that those gases are correctly tracked when editing a manually
added dive as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-08 18:15:04 +09:00
parent bf0bd88226
commit 1578c1edb2
7 changed files with 54 additions and 30 deletions

View file

@ -538,14 +538,13 @@ void MainTab::rejectChanges()
if (mainWindow() && mainWindow()->dive_list()->selectedTrips.count() == 1){
ui.notes->setText(notesBackup[NULL].notes );
ui.location->setText(notesBackup[NULL].location);
}else{
} else {
if (editMode == ADD) {
// clean up
delete_single_dive(selected_dive);
DivePlannerPointsModel::instance()->cancelPlan();
}
else if (editMode == MANUALLY_ADDED_DIVE ){
DivePlannerPointsModel::instance()->undoEdition();
} else if (editMode == MANUALLY_ADDED_DIVE ) {
DivePlannerPointsModel::instance()->undoEdition(); // that's BOGUS... just copy the original dive back and be done with it...
}
struct dive *curr = current_dive;
ui.notes->setText(notesBackup[curr].notes );