Hook up the code to toggle DC reported ceiling visibility

This got broken a long time ago it seems and no one ever noticed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-09-24 12:38:24 -07:00
parent 0e408cbadd
commit 0296a456b2
2 changed files with 8 additions and 0 deletions

View file

@ -897,6 +897,13 @@ void DiveCalculatedTissue::settingsChanged()
DiveCalculatedCeiling::setVisible(prefs.calcalltissues && prefs.calcceiling);
}
DiveReportedCeiling::DiveReportedCeiling()
{
connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::dcceilingChanged, this, &DiveReportedCeiling::setVisible);
setVisible(prefs.dcceiling);
settingsChanged();
}
void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
if (!shouldCalculateStuff(topLeft, bottomRight))

View file

@ -196,6 +196,7 @@ class DiveReportedCeiling : public AbstractProfilePolygonItem {
Q_OBJECT
public:
DiveReportedCeiling();
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
};