From 19588ce1399381129f86b4cc54e0c6522852e666 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Mon, 25 Jan 2016 18:44:51 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qt-mobile/qmlmanager.cpp') 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; +} -- cgit v1.2.3-70-g09d2