summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-21 19:32:46 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-23 07:51:22 -0700
commit607d450cd6d659a99fda9b73870d340a2e16af1f (patch)
tree9ecad03c2d085a8c94bbbda04326915e038c827a /qt-ui/profile/diveprofileitem.cpp
parent65eefe7b599575bf401c0adc9c61e42bc56fc4c9 (diff)
downloadsubsurface-607d450cd6d659a99fda9b73870d340a2e16af1f.tar.gz
Code cleanup: HeartRate item was doing insane things
This simplifies so much of the code that we were using to control the visibility of the HeartRate. now things are much saner. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index cb5cec58b..c5321d770 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -254,7 +254,7 @@ DiveHeartrateItem::DiveHeartrateItem()
pen.setCosmetic(true);
pen.setWidth(1);
setPen(pen);
- visible = true;
+ settingsChanged();
}
void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@@ -335,20 +335,7 @@ void DiveHeartrateItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
void DiveHeartrateItem::settingsChanged()
{
- QSettings s;
- s.beginGroup("TecDetails");
- visible = s.value(visibilityKey).toBool();
- setVisible(visible);
-}
-
-void DiveHeartrateItem::setVisibilitySettingsKey(const QString &key)
-{
- visibilityKey = key;
-}
-
-bool DiveHeartrateItem::isVisible()
-{
- return visible == true;
+ setVisible(prefs.hrgraph);
}
DiveTemperatureItem::DiveTemperatureItem()