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 <[email protected]>
---
 qt-mobile/qmlmanager.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index a4cfd5f..8767cef 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;
 }
 
-- 
2.4.9 (Apple Git-60)

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to