QML UI: don't combine multiple trips to the same location into one

The way sectioning of the dive list works is by watching for different strings
in the section.property. In order to be able to tell different trips apart we
combine the address of the dive trip variable with the location (which will
create a new section for a new trip, even if the location text is the same) and
then strip that information out before showing the trip header.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-01-26 20:06:30 -08:00
parent 6a8768ee26
commit 35e60a7355
3 changed files with 26 additions and 2 deletions

View file

@ -219,6 +219,16 @@ QString DiveObjectHelper::trip() const
return m_dive->divetrip ? m_dive->divetrip->location : EMPTY_DIVE_STRING;
}
// combine the pointer address with the trip location so that
// we detect multiple, destinct trips to the same location
QString DiveObjectHelper::tripMeta() const
{
QString ret = EMPTY_DIVE_STRING;
if (m_dive->divetrip)
ret = QString::number((quint64)m_dive->divetrip, 16) + QLatin1Literal("::") + m_dive->divetrip->location;
return ret;
}
QString DiveObjectHelper::maxcns() const
{
return QString(m_dive->maxcns);