From 83259008e763d3cc120c826f58f91a0ff62b6b92 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Sun, 28 Jan 2018 11:28:01 +0100 Subject: mobile cleanup: unduplicate code and do not loop over dives (3) See e6e1473e6. Exact same commit but here for the list of divemaster. The careful reader will spot a small addition to the clearDetailsEdit() QML function. Two more field are cleared. Signed-off-by: Jan Mulder --- core/subsurface-qt/DiveObjectHelper.cpp | 15 --------------- core/subsurface-qt/DiveObjectHelper.h | 2 -- 2 files changed, 17 deletions(-) (limited to 'core') diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 2e18b8f0a..9372f422f 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -428,18 +428,3 @@ QStringList DiveObjectHelper::locationList() const locations.sort(); return locations; } - -QStringList DiveObjectHelper::divemasterList() const -{ - QStringList divemasters; - struct dive *d; - int i = 0; - for_each_dive (i, d) { - QString temp = d->divemaster; - if (!temp.isEmpty()) - divemasters << d->divemaster; - } - divemasters.removeDuplicates(); - divemasters.sort(); - return divemasters; -} diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h index 28eaa6a41..5da82c29e 100644 --- a/core/subsurface-qt/DiveObjectHelper.h +++ b/core/subsurface-qt/DiveObjectHelper.h @@ -47,7 +47,6 @@ class DiveObjectHelper : public QObject { Q_PROPERTY(QString startPressure READ startPressure CONSTANT) Q_PROPERTY(QString endPressure READ endPressure CONSTANT) Q_PROPERTY(QString firstGas READ firstGas CONSTANT) - Q_PROPERTY(QStringList divemasterList READ divemasterList CONSTANT) Q_PROPERTY(QStringList locationList READ locationList CONSTANT) public: DiveObjectHelper(struct dive *dive = NULL); @@ -92,7 +91,6 @@ public: QString endPressure() const; QString firstGas() const; QStringList locationList() const; - QStringList divemasterList() const; private: struct dive *m_dive; -- cgit v1.2.3-70-g09d2