diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-11 16:13:23 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-11 15:47:07 -0800 |
commit | 04704d02c87434c5ba88b9bfb2f5d51b7f3695b5 (patch) | |
tree | 79b5c85511c9aff57bade8ca49f77c8d3eb8b400 /subsurface-core/subsurface-qt/DiveObjectHelper.cpp | |
parent | e2bc3b0e2439cecebe2138d9362085c58df94415 (diff) | |
download | subsurface-04704d02c87434c5ba88b9bfb2f5d51b7f3695b5.tar.gz |
Simplify: remove gps variable
And also use existing helper function to get the GPS string
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r-- | subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp index 3d9c9cb95..a06e5bbcb 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp @@ -36,10 +36,6 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx) DiveObjectHelper::DiveObjectHelper(struct dive *d) : m_dive(d) { - struct dive_site *ds = get_dive_site_by_uuid(d->dive_site_uuid); - if (ds) - m_gps = QString("%1,%2").arg(ds->latitude.udeg / 1000000.0).arg(ds->longitude.udeg / 1000000.0); - char buffer[256]; taglist_get_tagstring(d->tag_list, buffer, 256); m_tags = QString(buffer); @@ -117,7 +113,8 @@ QString DiveObjectHelper::location() const QString DiveObjectHelper::gps() const { - return m_gps; + 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::duration() const { |