summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-27 18:08:23 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-06 10:00:39 -0800
commitc584e28f2e0cc97cb2573d66697fdb0c0f160b66 (patch)
tree9e707b1aa2df7639f0c63e6138339eaecd9e8259 /desktop-widgets
parent64dae43bddf2894f0891b56e5f419e325309a66f (diff)
downloadsubsurface-c584e28f2e0cc97cb2573d66697fdb0c0f160b66.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp6
1 files changed, 3 insertions, 3 deletions
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<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());
}