diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-21 19:32:46 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-23 07:51:22 -0700 |
commit | 607d450cd6d659a99fda9b73870d340a2e16af1f (patch) | |
tree | 9ecad03c2d085a8c94bbbda04326915e038c827a /qt-ui/profile/diveprofileitem.cpp | |
parent | 65eefe7b599575bf401c0adc9c61e42bc56fc4c9 (diff) | |
download | subsurface-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.cpp | 17 |
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() |