aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurfacestartup.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-07-15 09:14:31 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-23 11:30:17 -0700
commit846e1ba53e32aaeae22b72d4a7843700627f2b27 (patch)
tree4843358441c48c37658da6826f08e983602391c8 /core/subsurfacestartup.h
parent72bdd506f07d6a2cc9652efe0353a85d9b8e481a (diff)
downloadsubsurface-846e1ba53e32aaeae22b72d4a7843700627f2b27.tar.gz
core: always create a fake profile if there are no samples
Before making the cylinder-table dynamic, dives always had at least one cylinger. When such a dive is displayed, the TabDiveInformation class calls per_cylinder_mean_depth(). If there are no samples, this function generates a "fake profile" with fake_dc(). Thus, effectively dives always had samples once the user was displaying them. When the cylinder-table was made dynamic, dives without cylinders were supported. This can notably happen, when importing from CSV (this could actually be a bug). per_cylinder_mean_depth() exits early in that case and doesn't create a fake profile. This lead to crashes of the profile-widget, which were fixed in 6b2e56e5131. Non-sample dives were now shown with the Subsurface-logo. To restore the previous behavior, genarate a fake profile for sample-less dives in fixup_dive(), which is called anytime a dive is loaded or imported. This seems to have been the intention anyway and this worked only "by chance". This will make a few fake_dc() calls obsolete, but so be it. Since fake profiles are now generated on loading, the parse-tests need to be fixed to account for that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurfacestartup.h')
0 files changed, 0 insertions, 0 deletions