core: add ability to get underlying dive to DiveObjectHelper

This feels a bit like cheating, but if we need to be able to make modifications
to the underlying dive and only have the helper object (for example inside of a
view model), doing everything through the helper object can turn into a real
performance issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-24 21:14:33 +01:00
parent 583d8d653a
commit 66184d58e8
2 changed files with 6 additions and 0 deletions

View file

@ -81,6 +81,11 @@ int DiveObjectHelper::id() const
return m_dive->id;
}
struct dive *DiveObjectHelper::getDive() const
{
return m_dive;
}
QString DiveObjectHelper::date() const
{
QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000*m_dive->when, Qt::UTC);

View file

@ -56,6 +56,7 @@ public:
~DiveObjectHelper();
int number() const;
int id() const;
struct dive *getDive() const;
int rating() const;
int visibility() const;
QString date() const;