From 75b5d61522f3721adb1761141ce1aeb79c3761c1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 25 Oct 2018 20:46:12 +0200 Subject: 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 --- core/subsurface-qt/DiveObjectHelper.cpp | 4 ++-- core/subsurface-qt/DiveObjectHelper.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core') 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; -- cgit v1.2.3-70-g09d2