diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-25 20:46:12 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | 75b5d61522f3721adb1761141ce1aeb79c3761c1 (patch) | |
tree | b9cb8f62df1d7fa2210b4b2c34ef8afb879bc5c1 /core | |
parent | 872d56de0122036e1b9d37348d758b40dcd142d9 (diff) | |
download | subsurface-75b5d61522f3721adb1761141ce1aeb79c3761c1.tar.gz |
Dive site: replace UUID by pointer in mobile code
Replace UUIDs by pointers to dive-site in mobile code. In both
cases, the value is transported via a QVariant. The function
getCoordinatesForUUID(), which was only used from mobile, can
be replaced by a getCoordinatesFor() function taking a variant
supposed to contain a dive-site pointer. Likewise, the variant
of the centerOnDiveSite function is now supposed to wrap a
pointer-to-divesite.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.cpp | 4 | ||||
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index d4b8e32cb..c605d01c8 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -127,9 +127,9 @@ QString DiveObjectHelper::gps_decimal() const return val; } -QVariant DiveObjectHelper::dive_site_uuid() const +QVariant DiveObjectHelper::dive_site() const { - return QVariant::fromValue(m_dive->dive_site_uuid); + return QVariant::fromValue((void *)get_dive_site_by_uuid(m_dive->dive_site_uuid)); } QString DiveObjectHelper::duration() const diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h index 1070b855e..c5f116e1a 100644 --- a/core/subsurface-qt/DiveObjectHelper.h +++ b/core/subsurface-qt/DiveObjectHelper.h @@ -20,7 +20,7 @@ class DiveObjectHelper : public QObject { Q_PROPERTY(QString location READ location CONSTANT) Q_PROPERTY(QString gps READ gps CONSTANT) Q_PROPERTY(QString gps_decimal READ gps_decimal CONSTANT) - Q_PROPERTY(QVariant dive_site_uuid READ dive_site_uuid CONSTANT) + Q_PROPERTY(QVariant dive_site READ dive_site CONSTANT) Q_PROPERTY(QString duration READ duration CONSTANT) Q_PROPERTY(bool noDive READ noDive CONSTANT) Q_PROPERTY(QString depth READ depth CONSTANT) @@ -65,7 +65,7 @@ public: QString location() const; QString gps() const; QString gps_decimal() const; - QVariant dive_site_uuid() const; + QVariant dive_site() const; QString duration() const; bool noDive() const; QString depth() const; |