From 009c91a8fc286f3f24dd0a4104be18b41378dc9a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 12 Jul 2021 22:48:09 +0200 Subject: [PATCH] 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 --- profile-widget/profilewidget2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index a10b817a2..c7d23b2d9 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -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