From c584e28f2e0cc97cb2573d66697fdb0c0f160b66 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 27 Jan 2021 18:08:23 +0100 Subject: 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 --- desktop-widgets/tab-widgets/maintab.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'desktop-widgets/tab-widgets/maintab.cpp') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 9bcc36cff..0170cdb40 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -269,7 +269,7 @@ void MainTab::divesChanged(const QVector &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()); } -- cgit v1.2.3-70-g09d2