Set showWithPPGraph so that animateChangeLine() is always called the
first time settingsChanged() is called.

Signed-off-by: Michael Andreen <[email protected]>
---
This time without word wrap..
 qt-ui/profile/divecartesianaxis.cpp | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/qt-ui/profile/divecartesianaxis.cpp 
b/qt-ui/profile/divecartesianaxis.cpp
index c6567d4..1cfd9d1 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;
        }
-- 
1.8.3.2
_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to