Cleanup: Turn QMLProfile::diveId from QString to int

This property is used to render the profile of a given dive.
Weirdly, even though the diveId is an integer, it was stored
as a string. It is not clear why that is the case. Therefore,
turn into the more natural int and avoid unnecessary conversion.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-12-23 20:52:41 +01:00 committed by Dirk Hohndel
parent 967f0e56d7
commit 19b8c9a33a
2 changed files with 8 additions and 8 deletions

View file

@ -80,17 +80,17 @@ void QMLProfile::setMargin(int margin)
m_margin = margin;
}
QString QMLProfile::diveId() const
int QMLProfile::diveId() const
{
return m_diveId;
}
void QMLProfile::setDiveId(const QString &diveId)
void QMLProfile::setDiveId(int diveId)
{
m_diveId = diveId;
struct dive *d = get_dive_by_uniq_id(m_diveId.toInt());
if (m_diveId.toInt() < 1)
if (m_diveId < 0)
return;
struct dive *d = get_dive_by_uniq_id(diveId);
if (!d)
return;
if (verbose)