From e522dd1a68d559f43a337e862f9f0a4d233d9272 Mon Sep 17 00:00:00 2001 From: pestophagous Date: Mon, 5 Oct 2015 22:21:44 -0700 Subject: Preserve profile toggle-button state zoomed_plot across sessions. Fixes #912 Signed-off-by: K. Heller Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 5b7c3832a..5d2b507a0 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -75,7 +75,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), background(new DivePixmapItem()), backgroundFile(":poster"), toolTipItem(new ToolTipItem()), - isPlotZoomed(prefs.zoomed_plot), + isPlotZoomed(prefs.zoomed_plot),// no! bad use of prefs. 'PreferencesDialog::loadSettings' NOT CALLED yet. profileYAxis(new DepthAxis()), gasYAxis(new PartialGasPressureAxis()), temperatureAxis(new TemperatureAxis()), @@ -111,6 +111,9 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), shouldCalculateMaxDepth(true), fontPrintScale(1.0) { + // would like to be able to ASSERT here that PreferencesDialog::loadSettings has been called. + isPlotZoomed = prefs.zoomed_plot; // now it seems that 'prefs' has loaded our preferences + memset(&plotInfo, 0, sizeof(plotInfo)); setupSceneAndFlags(); -- cgit v1.2.3-70-g09d2