diff options
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 8 | ||||
-rw-r--r-- | qt-ui/profile/diveprofileitem.h | 4 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 6 |
3 files changed, 9 insertions, 9 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() diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index 86e90224a..1bdf4b368 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -211,13 +211,13 @@ public: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex()); virtual void settingsChanged(); - void setThreshouldSettingsKey(const QString &threshouldSettingsKey); + void setThreshouldSettingsKey(double *prefPointer); void setVisibilitySettingsKey(const QString &setVisibilitySettingsKey); void setColors(const QColor &normalColor, const QColor &alertColor); private: QVector<QPolygonF> alertPolygons; - QString threshouldKey; + double *thresholdPtr; QString visibilityKey; QColor normalColor; QColor alertColor; diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 17cb19f65..76b5cc1e9 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -272,9 +272,9 @@ void ProfileWidget2::setupItemOnScene() ITEM->settingsChanged(); \ ITEM->setZValue(99); - CREATE_PP_GAS(pn2GasItem, PN2, PN2, PN2_ALERT, "pn2threshold", "pn2graph"); - CREATE_PP_GAS(pheGasItem, PHE, PHE, PHE_ALERT, "phethreshold", "phegraph"); - CREATE_PP_GAS(po2GasItem, PO2, PO2, PO2_ALERT, "po2threshold", "po2graph"); + CREATE_PP_GAS(pn2GasItem, PN2, PN2, PN2_ALERT, &prefs.pp_graphs.pn2_threshold, "pn2graph"); + CREATE_PP_GAS(pheGasItem, PHE, PHE, PHE_ALERT, &prefs.pp_graphs.phe_threshold, "phegraph"); + CREATE_PP_GAS(po2GasItem, PO2, PO2, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "po2graph"); #undef CREATE_PP_GAS temperatureAxis->setTextVisible(false); |