diff options
Diffstat (limited to 'subsurface-core/subsurface-qt')
-rw-r--r-- | subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 5 | ||||
-rw-r--r-- | subsurface-core/subsurface-qt/DiveObjectHelper.h | 10 |
2 files changed, 11 insertions, 4 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); diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h b/subsurface-core/subsurface-qt/DiveObjectHelper.h index a4a425ac0..0584f8836 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.h +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h @@ -16,6 +16,7 @@ class DiveObjectHelper : public QObject { Q_PROPERTY(QString location READ location CONSTANT) Q_PROPERTY(QString gps READ gps CONSTANT) Q_PROPERTY(QString duration READ duration CONSTANT) + Q_PROPERTY(bool noDive READ noDive CONSTANT) Q_PROPERTY(QString depth READ depth CONSTANT) Q_PROPERTY(QString divemaster READ divemaster CONSTANT) Q_PROPERTY(QString buddy READ buddy CONSTANT) @@ -34,10 +35,10 @@ class DiveObjectHelper : public QObject { Q_PROPERTY(QString maxcns READ maxcns CONSTANT) Q_PROPERTY(QString otu READ otu CONSTANT) Q_PROPERTY(QString sumWeight READ sumWeight CONSTANT) - Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT) - Q_PROPERTY(QString startPressure READ startPressure CONSTANT) - Q_PROPERTY(QString endPressure READ endPressure CONSTANT) - Q_PROPERTY(QString firstGas READ firstGas CONSTANT) + Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT) + Q_PROPERTY(QString startPressure READ startPressure CONSTANT) + Q_PROPERTY(QString endPressure READ endPressure CONSTANT) + Q_PROPERTY(QString firstGas READ firstGas CONSTANT) public: DiveObjectHelper(struct dive *dive = NULL); ~DiveObjectHelper(); @@ -50,6 +51,7 @@ public: QString location() const; QString gps() const; QString duration() const; + bool noDive() const; QString depth() const; QString divemaster() const; QString buddy() const; |