summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2016-01-25 21:28:10 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-25 12:55:04 -0800
commit5afda93b71880395a78c121b76c234e1953edf1b (patch)
tree27738959c372f29a5f9056b3ba90622dcb6891a3 /qt-mobile/qmlmanager.cpp
parente0725966b1740f35c986466210bb384f1ece1b7f (diff)
downloadsubsurface-5afda93b71880395a78c121b76c234e1953edf1b.tar.gz
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 <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.cpp10
1 files changed, 8 insertions, 2 deletions
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;
}