profile: update profile in edit mode on undo

When the user undos/redos the profile should update even
when in edit mode. This is a bit more complicated than
anticipated:

1) We should not do the update when emitting an undo command
from the profile. But we *should* update if it is an undo
command from the maintab (change depth/time).

2) The divepointsplannermodel has to be reset. Side note:
the code is truly abysmal as it sends numerous changed-signals.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-03-02 20:50:50 +01:00
parent 5aa67c134b
commit 4c46a11ed1
3 changed files with 41 additions and 5 deletions

View file

@ -213,10 +213,6 @@ void MainTab::divesChanged(const QVector<dive *> &dives, DiveField field)
ui.buddy->setText(current_dive->buddy);
if (field.diveguide)
ui.diveguide->setText(current_dive->diveguide);
// If duration or depth changed, the profile needs to be replotted
if (field.duration || field.depth)
MainWindow::instance()->refreshProfile();
}
void MainTab::diveSiteEdited(dive_site *ds, int)