diff options
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 16 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 3 |
2 files changed, 18 insertions, 1 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; diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 04f4a40dd..f6b310575 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -33,6 +33,7 @@ class QMLManager : public QObject { Q_PROPERTY(QStringList suitInit READ suitInit CONSTANT) Q_PROPERTY(QStringList buddyInit READ buddyInit CONSTANT) Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT) + Q_PROPERTY(QStringList cylinderInit READ cylinderInit CONSTANT) Q_PROPERTY(bool showPin READ showPin WRITE setShowPin NOTIFY showPinChanged) public: @@ -108,7 +109,7 @@ public: QStringList suitInit() const; QStringList buddyInit() const; QStringList divemasterInit() const; - + QStringList cylinderInit() const; bool showPin() const; void setShowPin(bool enable); |