From 5afda93b71880395a78c121b76c234e1953edf1b Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Mon, 25 Jan 2016 21:28:10 +0100 Subject: QML UI: If a dive has multiple cylinders show "Multiple" in the details page Since we are short on space on the mobile version, lets just show "Multiple" if a dive has multiple cylinders. Signed-off-by: Joakim Bygdell Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'qt-mobile') diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index a4cfd5fd4..8767cef93 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -714,8 +714,14 @@ 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; + if (d){ + if (d->cylinder[1].type.description != NULL){ + cylinder = "Multiple"; + } + else { + cylinder = d->cylinder[0].type.description; + } + } return cylinder; } -- cgit v1.2.3-70-g09d2