mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use helper function dive_endtime() where apropriate
Calculating dive.when + dive.duration doesn't always give the correct endtime of a dive especially when a dive has surface interval(s) in the middle. Using the helper function dive_endtime() fixes this issue. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
325c4459ad
commit
7713c7e607
6 changed files with 20 additions and 18 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <core/helpers.h>
|
||||
#include <core/statistics.h>
|
||||
#include <core/display.h>
|
||||
#include <core/dive.h>
|
||||
|
||||
TabDiveInformation::TabDiveInformation(QWidget *parent) : TabBase(parent), ui(new Ui::TabDiveInformation())
|
||||
{
|
||||
|
@ -81,7 +82,7 @@ void TabDiveInformation::updateData()
|
|||
process_all_dives(&displayed_dive, &prevd);
|
||||
|
||||
if (prevd)
|
||||
ui->surfaceIntervalText->setText(get_dive_surfint_string(displayed_dive.when - (prevd->when + prevd->duration.seconds), tr("d"), tr("h"), tr("min")));
|
||||
ui->surfaceIntervalText->setText(get_dive_surfint_string(displayed_dive.when - (dive_endtime(prevd)), tr("d"), tr("h"), tr("min")));
|
||||
|
||||
else
|
||||
ui->surfaceIntervalText->clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue