From ae222f147cd1e32c4bf4802b303c63c6be42e796 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 11 Jan 2016 15:35:21 -0200 Subject: [PATCH] Simplify: removed location variable Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 5 ++--- subsurface-core/subsurface-qt/DiveObjectHelper.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp index ee1beb271..e50dc91aa 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp @@ -34,8 +34,7 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx) } DiveObjectHelper::DiveObjectHelper(struct dive *d) : - m_location(get_dive_location(d) ? QString::fromUtf8(get_dive_location(d)) : EMPTY_DIVE_STRING), - m_duration(get_dive_duration_string(d->duration.seconds, QObject::tr("h:"), QObject::tr("min"))), + m_duration(get_dive_duration_string(d->duration.seconds, QObject::tr("h:"), QObject::tr("min"))), m_depth(get_depth_string(d->dc.maxdepth.mm, true, true)), m_divemaster(d->divemaster ? d->divemaster : EMPTY_DIVE_STRING), m_buddy(d->buddy ? d->buddy : EMPTY_DIVE_STRING), @@ -150,7 +149,7 @@ QString DiveObjectHelper::time() const QString DiveObjectHelper::location() const { - return m_location; + return get_dive_location(m_dive) ? QString::fromUtf8(get_dive_location(m_dive)) : EMPTY_DIVE_STRING; } QString DiveObjectHelper::gps() const diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h b/subsurface-core/subsurface-qt/DiveObjectHelper.h index b79ce43f5..f135466c4 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.h +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h @@ -64,7 +64,6 @@ public: private: QString m_date; QString m_time; - QString m_location; QString m_gps; QString m_duration; QString m_depth;