core: turn C dive-table into an owning table

This is a humongous commit, because it touches all parts of the
code. It removes the last user of our horrible TABLE macros, which
simulate std::vector<> in a very clumsy way.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-07 10:25:09 +02:00 committed by bstoeger
parent f00c30ad4a
commit b95ac3f79c
73 changed files with 1030 additions and 1230 deletions

View file

@ -2,6 +2,7 @@
#include "qmlprofile.h"
#include "profilescene.h"
#include "mobile-widgets/qmlmanager.h"
#include "core/divelist.h"
#include "core/errorhelper.h"
#include "core/subsurface-float.h"
#include "core/metrics.h"
@ -60,7 +61,7 @@ void QMLProfile::paint(QPainter *painter)
painter->resetTransform();
if (m_diveId < 0)
return;
struct dive *d = get_dive_by_uniq_id(m_diveId);
struct dive *d = divelog.dives.get_by_uniq_id(m_diveId);
if (!d)
return;
m_profileWidget->draw(painter, painterRect, d, m_dc, nullptr, false);
@ -143,7 +144,7 @@ void QMLProfile::prevDC()
void QMLProfile::rotateDC(int dir)
{
struct dive *d = get_dive_by_uniq_id(m_diveId);
struct dive *d = divelog.dives.get_by_uniq_id(m_diveId);
if (!d)
return;
int numDC = number_of_computers(d);
@ -157,6 +158,6 @@ void QMLProfile::rotateDC(int dir)
int QMLProfile::numDC() const
{
struct dive *d = get_dive_by_uniq_id(m_diveId);
struct dive *d = divelog.dives.get_by_uniq_id(m_diveId);
return d ? number_of_computers(d) : 0;
}