cleanup: remove default-code for editCurrentDive

The profile can only be edited for manually added or planned
dives. No point in keeping code for other kinds of dives.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-28 08:36:13 +01:00
parent 1aa25aad6d
commit 1aa06e6802

View file

@ -1793,21 +1793,19 @@ void MainWindow::editCurrentDive()
struct dive *d = current_dive;
QString defaultDC(d->dc.model);
DivePlannerPointsModel::instance()->clear();
disableShortcuts();
if (defaultDC == "manually added dive") {
disableShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
graphics->setAddState();
setApplicationState(ApplicationState::EditDive);
DivePlannerPointsModel::instance()->loadFromDive(d);
mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
} else if (defaultDC == "planned dive") {
disableShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
setApplicationState(ApplicationState::EditPlannedDive);
DivePlannerPointsModel::instance()->loadFromDive(d);
mainTab->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
} else {
setApplicationState(ApplicationState::EditDive);
mainTab->enableEdition();
}
}