core: make get_surface_interval() member of dive_table

This function implicitely accessed the global divelog. To make
that explicit make it a member of dive_table, such that the
caller must access it via the global variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-18 21:01:16 +02:00 committed by bstoeger
parent e9a57ac5f5
commit cce5f5950c
3 changed files with 6 additions and 8 deletions

View file

@ -167,7 +167,7 @@ void TabDiveInformation::updateProfile()
// Update fields that depend on start of dive
void TabDiveInformation::updateWhen()
{
timestamp_t surface_interval = get_surface_interval(parent.currentDive->when);
timestamp_t surface_interval = divelog.dives.get_surface_interval(parent.currentDive->when);
if (surface_interval >= 0)
ui->surfaceIntervalText->setText(get_dive_surfint_string(surface_interval, tr("d"), tr("h"), tr("min")));
else