desktop: don't access profile directly to redraw it

The MainWindow has a function to replot the profile. Use that
instead of accessing the profile directly.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-27 18:08:23 +01:00 committed by Dirk Hohndel
parent 64dae43bdd
commit c584e28f2e

View file

@ -269,7 +269,7 @@ void MainTab::divesChanged(const QVector<dive *> &dives, DiveField field)
// If duration or depth changed, the profile needs to be replotted
if (field.duration || field.depth)
MainWindow::instance()->graphics->plotDive(current_dive, true);
MainWindow::instance()->refreshProfile();
}
void MainTab::diveSiteEdited(dive_site *ds, int)
@ -513,7 +513,7 @@ void MainTab::acceptChanges()
if (editMode) {
MainWindow::instance()->diveList->reload();
MainWindow::instance()->refreshDisplay();
MainWindow::instance()->graphics->plotDive(current_dive, true);
MainWindow::instance()->refreshProfile();
} else {
MainWindow::instance()->refreshDisplay();
}
@ -549,7 +549,7 @@ void MainTab::rejectChanges()
updateDiveInfo();
// show the profile and dive info
MainWindow::instance()->graphics->plotDive(current_dive, true);
MainWindow::instance()->refreshProfile();
MainWindow::instance()->setEnabledToolbar(true);
ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
}