Berthold Stoeger 846e1ba53e 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>
2021-07-23 11:30:17 -07:00
..
2018-01-08 06:06:12 +02:00
2015-03-10 10:03:08 -07:00
2014-01-08 21:54:29 +08:00
2011-11-04 14:54:22 -07:00
2012-09-17 21:03:30 -04:00
2013-12-28 07:40:54 -08:00
2014-02-06 11:29:23 -08:00
2014-04-07 14:20:01 -07:00
2014-11-17 00:24:33 +00:00
2015-04-24 07:07:31 -07:00
2015-03-14 18:15:08 -07:00
2015-03-16 12:42:36 -07:00
2017-02-21 13:14:56 -08:00
2021-02-26 08:42:30 -08:00
2019-04-12 18:19:07 +03:00
2013-02-26 08:50:05 -08:00
2013-03-05 11:08:08 -08:00
2015-07-13 15:21:30 -07:00
2013-12-24 10:43:29 -08:00