profile: call DiveCalculatedTissue::setVisible() correctly

This one is rich: when changing to profile-mode, the calculated
tissues are set according to the prefs.calcalltissues flag.

The DiveCalculatedTissue::setVisible() function ignores the
parameter and insteads sets the visibility according to the
expression "prefs.calcalltissues && prefs.calcceiling".

This is because the function is also called by signals,
which provide the wrong parameter.

Pass the correct parameter in the first place. Remove the
crazy signals and the overridden setVisible() function,
which ignores its parameter, later.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-07-12 22:48:09 +02:00 committed by Dirk Hohndel
parent adf6e6d31e
commit 009c91a8fc

View file

@ -1119,7 +1119,7 @@ void ProfileWidget2::updateVisibility()
decoModelParameters->setVisible(prefs.calcceiling);
#ifndef SUBSURFACE_MOBILE
for (DiveCalculatedTissue *tissue: allTissues)
tissue->setVisible(prefs.calcalltissues);
tissue->setVisible(prefs.calcalltissues && prefs.calcceiling);
for (DivePercentageItem *percentage: allPercentages)
percentage->setVisible(prefs.percentagegraph);
#endif