mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
58f014728c
commit
06ad45c48f
2 changed files with 11 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue