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>
This commit is contained in:
Tomaz Canabrava 2016-01-11 16:13:23 -02:00 committed by Dirk Hohndel
parent e2bc3b0e24
commit 04704d02c8
2 changed files with 2 additions and 6 deletions

View file

@ -36,10 +36,6 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx)
DiveObjectHelper::DiveObjectHelper(struct dive *d) : DiveObjectHelper::DiveObjectHelper(struct dive *d) :
m_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]; char buffer[256];
taglist_get_tagstring(d->tag_list, buffer, 256); taglist_get_tagstring(d->tag_list, buffer, 256);
m_tags = QString(buffer); m_tags = QString(buffer);
@ -117,7 +113,8 @@ QString DiveObjectHelper::location() const
QString DiveObjectHelper::gps() 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 QString DiveObjectHelper::duration() const
{ {

View file

@ -64,7 +64,6 @@ public:
private: private:
QString m_date; QString m_date;
QString m_time; QString m_time;
QString m_gps;
QString m_tags; QString m_tags;
QString m_gas; QString m_gas;
QString m_sac; QString m_sac;