diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-25 21:45:29 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-04-02 13:53:23 -0700 |
commit | e419ebf55a28d2483951e52ca274aedd96f11789 (patch) | |
tree | 32d5168bdaa00cde2216842f62c005fa21779db5 /desktop-widgets | |
parent | 02ef58a48bfa9042e034e83cb128ae6b7f83628e (diff) | |
download | subsurface-e419ebf55a28d2483951e52ca274aedd96f11789.tar.gz |
planner: move clearing of model into loadFromDive() function
Both loadFromDive() callers were clearing the model before
calling loadFromDive(). Move the clearing into that function
since it makes no sense to load into a non-cleared model.
Apparently this changes the way that no-cylinder dives are
treated and the code in ProfileWidget2::repositionDiveHandlers()
must now explicitly check for that condition.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 1 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index 014745909..ab2fa8b75 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -563,7 +563,6 @@ void PlannerWidgets::planDive() void PlannerWidgets::replanDive() { - DivePlannerPointsModel::instance()->clear(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); MainWindow::instance()->graphics->setPlanState(); diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 03f0dc57c..2230b05fc 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -1514,7 +1514,6 @@ void MainWindow::editCurrentDive() return; disableShortcuts(); - DivePlannerPointsModel::instance()->clear(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); graphics->setAddState(); setApplicationState(ApplicationState::EditDive); |