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>
This commit is contained in:
Tomaz Canabrava 2014-07-21 19:32:46 -03:00 committed by Dirk Hohndel
parent 65eefe7b59
commit 607d450cd6
3 changed files with 9 additions and 30 deletions

View file

@ -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()