summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-14 17:32:32 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-14 17:32:45 -0700
commit6a50efd80a09565181553dce3058ece53a528c67 (patch)
treefd83afc6d27732a04bb8546d59206668c570b852 /mobile-widgets/qmlmanager.cpp
parente42bf2cfa577a68d7f37dc1f4f78c58ce79536b2 (diff)
downloadsubsurface-6a50efd80a09565181553dce3058ece53a528c67.tar.gz
QML UI: create completion list for cylinders as well
We already have that for the other three fields where we offer auto completion (buddy, divemaster, suit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index d24a4579d..ea90660c5 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1484,6 +1484,22 @@ QStringList QMLManager::divemasterInit() const
return divemasters;
}
+QStringList QMLManager::cylinderInit() const
+{
+ QStringList cylinders;
+ struct dive *d;
+ int i = 0;
+ for_each_dive (i, d) {
+ for (int j = 0; j < MAX_CYLINDERS; j++) {
+ if (! same_string(d->cylinder[j].type.description, ""))
+ cylinders << d->cylinder[j].type.description;
+ }
+ }
+ cylinders.removeDuplicates();
+ cylinders.sort();
+ return cylinders;
+}
+
bool QMLManager::showPin() const
{
return m_showPin;