diff options
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.cpp | 17 | ||||
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 8e5890b4c..7a3767409 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -426,6 +426,23 @@ QStringList DiveObjectHelper::suitList() const return suits; } +QStringList DiveObjectHelper::locationList() const +{ + QStringList locations; + struct dive *d; + struct dive_site *ds; + int i = 0; + for_each_dive (i, d) { + ds = get_dive_site_by_uuid(d->dive_site_uuid); + QString temp = ds->name; + if (!temp.isEmpty()) + locations << temp; + } + locations.removeDuplicates(); + locations.sort(); + return locations; +} + QStringList DiveObjectHelper::buddyList() const { QStringList buddies; diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h index 83aea4841..49542ca62 100644 --- a/core/subsurface-qt/DiveObjectHelper.h +++ b/core/subsurface-qt/DiveObjectHelper.h @@ -50,6 +50,7 @@ class DiveObjectHelper : public QObject { Q_PROPERTY(QStringList suitList READ suitList CONSTANT) Q_PROPERTY(QStringList buddyList READ buddyList CONSTANT) Q_PROPERTY(QStringList divemasterList READ divemasterList CONSTANT) + Q_PROPERTY(QStringList locationList READ locationList CONSTANT) public: DiveObjectHelper(struct dive *dive = NULL); ~DiveObjectHelper(); @@ -93,6 +94,7 @@ public: QString endPressure() const; QString firstGas() const; QStringList suitList() const; + QStringList locationList() const; QStringList buddyList() const; QStringList divemasterList() const; |