core: replace dive_site::dives by an std::vector<>

Since this is now in C++, we don't have to use our crazy
TABLE_* macros.

This contains a logic change: the dives associated to a
dive site are now unsorted.

The old code was subtly buggy: dives were added in a sorted
manner, but when the dive was edited the list was not
resorted. Very unlikely that this leads to a serious
problem, still not good.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-04 14:41:04 +02:00
parent 8797aa499a
commit c6f9ca8009
12 changed files with 39 additions and 45 deletions

View file

@ -330,7 +330,7 @@ std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly)
struct dive_site *ds = get_dive_site(i, divelog.sites);
if (dive_site_is_empty(ds))
continue;
if (selectedOnly && !is_dive_site_selected(ds))
if (selectedOnly && !is_dive_site_selected(*ds))
continue;
res.push_back(ds);
}