core: move number_of_divecomputers to struct dive

Feels natural in a C++ code base.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-30 17:16:14 +02:00 committed by bstoeger
parent e90251b0cf
commit 6e29c00f35
8 changed files with 12 additions and 12 deletions

View file

@ -147,7 +147,7 @@ void QMLProfile::rotateDC(int dir)
struct dive *d = divelog.dives.get_by_uniq_id(m_diveId);
if (!d)
return;
int numDC = number_of_computers(d);
int numDC = d->number_of_computers();
if (numDC == 1)
return;
m_dc = (m_dc + dir) % numDC;
@ -159,5 +159,5 @@ void QMLProfile::rotateDC(int dir)
int QMLProfile::numDC() const
{
struct dive *d = divelog.dives.get_by_uniq_id(m_diveId);
return d ? number_of_computers(d) : 0;
return d ? d->number_of_computers() : 0;
}