summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-01 18:09:03 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-08 20:42:06 +0100
commitec8e109a1a67a34deb00dbd8c2d4107d46e95499 (patch)
tree967b05ab88ab37327000c02acd79ae51b312da30 /profile-widget
parenta3a3913e1e8955da0dd65011b4c5e67803e2c4da (diff)
downloadsubsurface-ec8e109a1a67a34deb00dbd8c2d4107d46e95499.tar.gz
Profile: remove ProfileWidget2::recalcCeiling()
The ProfileWidget2::recalcCeiling() function is used in one place, namely when an undo-command changes the mode. It recalculates decompression data and repaints the ceilings and thus avoids a full profile-redraw. This is smart, but it becomes problematic when the dive is changed and the ceiling is recalculated before the profile is redrawn. The DivePlotDataModel then still has data from the previous dive but cylinders of the new dive are accessed. This kind of situation may arise if multiple dive fields are updated, as for example when replanning a dive. Currently, this only causes a temporary mis-calculation. When removing MAX_CYLINDERS this will lead to crashes. One might attempt to fix the whole data-dependency mess. This commit goes the cheap route and simply redraws the profile when the mode is changed. Yes, it is in a way ineffective, but we do worse things. The ProfileWidget2::recalcCeiling() thus becomes unused and is removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp7
-rw-r--r--profile-widget/profilewidget2.h1
2 files changed, 0 insertions, 8 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 186638a41..40bd92fb9 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -839,13 +839,6 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
#endif
}
-void ProfileWidget2::recalcCeiling()
-{
-#ifndef SUBSURFACE_MOBILE
- diveCeiling->recalc();
-#endif
-}
-
void ProfileWidget2::dateTimeChanged()
{
emit dateTimeChangedItems();
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 2956b18a5..a5895da63 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -87,7 +87,6 @@ public:
bool eventFilter(QObject *, QEvent *) override;
void clearHandlers();
#endif
- void recalcCeiling();
void setToolTipVisibile(bool visible);
State currentState;
int animSpeed;