summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-02-28 08:36:13 +0100
committerGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-07 00:13:35 +0200
commit1aa06e680230351024c05152aeca9a189c5a8d4f (patch)
tree80931ee14ddbc23d0d849d43eae897362d368dec /desktop-widgets/mainwindow.cpp
parent1aa25aad6dd553b80dbc8db18e513847121bea58 (diff)
downloadsubsurface-1aa06e680230351024c05152aeca9a189c5a8d4f.tar.gz
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>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 78877d1a5..e1d87b7e6 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -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();
}
}