summaryrefslogtreecommitdiffstats
path: root/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-14 16:26:37 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-14 16:26:37 -0800
commit06ad45c48f942738c0647ccc4f01d79e6a287e2e (patch)
tree03e45b37f488368e34a3466a6516841fe3f02436 /subsurface-core/subsurface-qt/DiveObjectHelper.cpp
parent58f014728c5a8590dfbcd1d777bfd3e17240da5d (diff)
downloadsubsurface-06ad45c48f942738c0647ccc4f01d79e6a287e2e.tar.gz
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>
Diffstat (limited to 'subsurface-core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--subsurface-core/subsurface-qt/DiveObjectHelper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
index b05138980..376380b8c 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
@@ -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);