summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
authorGravatar Michael Andreen <harv@ruin.nu>2014-02-05 21:58:21 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-05 15:36:29 -0800
commitddd7d2edccdd0460924ac65a78d89a546a47e4a8 (patch)
treeefbaafcd7db2ed8fe50490686bac16862ebd52e0 /qt-ui/profile/divecartesianaxis.cpp
parent3217201bb72086cbd266fb161a4a13b893e7bb99 (diff)
downloadsubsurface-ddd7d2edccdd0460924ac65a78d89a546a47e4a8.tar.gz
Fix DepthAxis when partial pressures aren't used.
Set showWithPPGraph so that animateChangeLine() is always called the first time settingsChanged() is called. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index c6567d413..1cfd9d13b 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -259,18 +259,26 @@ QColor DepthAxis::colorForValue(double value)
return QColor(Qt::red);
}
+static bool isPPGraphEnabled()
+{
+ QSettings s;
+
+ s.beginGroup("TecDetails");
+ return s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool();
+}
+
DepthAxis::DepthAxis() : showWithPPGraph(false)
{
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
- settingsChanged(); // force the correct size of the line.
+
+ // force the correct size of the line.
+ showWithPPGraph = !isPPGraphEnabled();
+ settingsChanged();
}
void DepthAxis::settingsChanged()
{
- QSettings s;
-
- s.beginGroup("TecDetails");
- bool ppGraph = s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool();
+ bool ppGraph = isPPGraphEnabled();
if ( ppGraph == showWithPPGraph){
return;
}