Add dive property to easily test if there isn't an actual dive

Right now this just tests for zero duration, but maybe this should also
return true for positive duration and max depth of 0.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-02-14 16:26:37 -08:00
parent 58f014728c
commit 06ad45c48f
2 changed files with 11 additions and 4 deletions

View file

@ -103,6 +103,11 @@ QString DiveObjectHelper::duration() const
return get_dive_duration_string(m_dive->duration.seconds, QObject::tr("h:"), QObject::tr("min"));
}
bool DiveObjectHelper::noDive() const
{
return m_dive->duration.seconds == 0 && m_dive->dc.duration.seconds == 0;
}
QString DiveObjectHelper::depth() const
{
return get_depth_string(m_dive->dc.maxdepth.mm, true, true);