diff options
author | Joakim Bygdell <j.bygdell@gmail.com> | 2016-01-25 18:44:51 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-25 11:14:30 -0800 |
commit | 19588ce1399381129f86b4cc54e0c6522852e666 (patch) | |
tree | 7327dbde6a2ec8a77354284434a670c7b50ba178 /qt-mobile/qmlmanager.cpp | |
parent | 1c3a1433e42dd69f823cea78ea2862ea14620f9b (diff) | |
download | subsurface-19588ce1399381129f86b4cc54e0c6522852e666.tar.gz |
QML UI: Add helper function to get cylinder info
Helper function that retrieves the cylinder description to be displayed in the
DiveDetails. Only the first cylinder for a dive is retrieved.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index a84e46dd4..d2b5c4702 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -708,3 +708,13 @@ QString QMLManager::getDate(QString diveId) datestring = get_dive_date_string(d->when); return datestring; } + +QString QMLManager::getCylinder(QString diveId) +{ + int dive_id = diveId.toInt(); + struct dive *d = get_dive_by_uniq_id(dive_id); + QString cylinder; + if (d) + cylinder = d->cylinder[0].type.description; + return cylinder; +} |