diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-01 09:22:07 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-01 09:22:07 -0700 |
commit | 89e7cae8549c801660b08c2b070e00ff77d562b6 (patch) | |
tree | 8ae0fc59c548ea0e9d1b212dbab344f0fb78b0e9 /qt-ui/profile/diveprofileitem.cpp | |
parent | f0cee72444b2433d140b54c2b236aafc21932a8f (diff) | |
download | subsurface-89e7cae8549c801660b08c2b070e00ff77d562b6.tar.gz |
Fix partial pressure graph thresholds
Since we only store things in the preferences if they are different from
the default, the existing code that simply compared with the settings
value didn't work when people used the defaults.
We now compare to the actual preference at runtime which should address
that.
Fixes #731
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 1e7a5b535..1a6eeae5c 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -833,14 +833,14 @@ void PartialPressureGasItem::modelDataChanged(const QModelIndex &topLeft, const alertPolygons.clear(); QSettings s; s.beginGroup("TecDetails"); - double threshould = s.value(threshouldKey).toDouble(); + double threshold = *thresholdPtr; bool inAlertFragment = false; for (int i = 0; i < dataModel->rowCount(); i++, entry++) { double value = dataModel->index(i, vDataColumn).data().toDouble(); int time = dataModel->index(i, hDataColumn).data().toInt(); QPointF point(hAxis->posAtValue(time), vAxis->posAtValue(value)); poly.push_back(point); - if (value >= threshould) { + if (value >= threshold) { if (inAlertFragment) { alertPolygons.back().push_back(point); } else { @@ -873,9 +873,9 @@ void PartialPressureGasItem::paint(QPainter *painter, const QStyleOptionGraphics painter->restore(); } -void PartialPressureGasItem::setThreshouldSettingsKey(const QString &threshouldSettingsKey) +void PartialPressureGasItem::setThreshouldSettingsKey(double *prefPointer) { - threshouldKey = threshouldSettingsKey; + thresholdPtr = prefPointer; } PartialPressureGasItem::PartialPressureGasItem() |