diff options
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.cpp | 12 | ||||
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.h | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveDetailsView.qml | 4 |
4 files changed, 17 insertions, 3 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 9814f9a6a..e77d3a186 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -109,6 +109,18 @@ QString DiveObjectHelper::gps() const struct dive_site *ds = get_dive_site_by_uuid(m_dive->dive_site_uuid); return ds ? QString(printGPSCoords(ds->latitude.udeg, ds->longitude.udeg)) : QString(); } + +QString DiveObjectHelper::gps_decimal() const +{ + bool savep = prefs.coordinates_traditional; + QString val; + + prefs.coordinates_traditional = false; + val = gps(); + prefs.coordinates_traditional = savep; + return(val); +} + QString DiveObjectHelper::duration() const { return get_dive_duration_string(m_dive->duration.seconds, QObject::tr("h:"), QObject::tr("min")); diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h index 8650f7a98..81887d356 100644 --- a/core/subsurface-qt/DiveObjectHelper.h +++ b/core/subsurface-qt/DiveObjectHelper.h @@ -18,6 +18,7 @@ class DiveObjectHelper : public QObject { Q_PROPERTY(int timestamp READ timestamp CONSTANT) 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(QString duration READ duration CONSTANT) Q_PROPERTY(bool noDive READ noDive CONSTANT) Q_PROPERTY(QString depth READ depth CONSTANT) @@ -60,6 +61,7 @@ public: QString time() const; QString location() const; QString gps() const; + QString gps_decimal() const; QString duration() const; bool noDive() const; QString depth() const; diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 0a7680ef8..076a63576 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -89,7 +89,7 @@ Kirigami.Page { text: qsTr("Show on map") iconName: "gps" onTriggered: { - showMap(diveDetailsListView.currentItem.modelData.dive.gps) + showMap(diveDetailsListView.currentItem.modelData.dive.gps_decimal) } } diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index c43b8a313..79602e645 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -53,8 +53,8 @@ Item { MouseArea { anchors.fill: parent onClicked: { - if (dive.gps !== "") - showMap(dive.gps) + if (dive.gps_decimal !== "") + showMap(dive.gps_decimal) } } } |