From 50b11024d685129e78c36313b892dbc0e55c654c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 11 Dec 2020 22:34:35 +0100 Subject: core: keep tank infos in a dynamic table The list of known tank types were kept in a fixed size table. Instead, use a dynamic table with our horrendous table macros. This is more flexible and sensible. While doing this, clean up the TankInfoModel, which was leaking memory. Signed-off-by: Berthold Stoeger --- core/subsurface-qt/diveobjecthelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/subsurface-qt') diff --git a/core/subsurface-qt/diveobjecthelper.cpp b/core/subsurface-qt/diveobjecthelper.cpp index 1df949b0f..1fa91a301 100644 --- a/core/subsurface-qt/diveobjecthelper.cpp +++ b/core/subsurface-qt/diveobjecthelper.cpp @@ -241,8 +241,8 @@ QStringList getFullCylinderList() addStringToSortedList(cylinders, get_cylinder(d, j)->type.description); } - for (int ti = 0; ti < MAX_TANK_INFO; ti++) - addStringToSortedList(cylinders, tank_info[ti].name); + for (int ti = 0; ti < tank_info_table.nr; ti++) + addStringToSortedList(cylinders, tank_info_table.infos[ti].name); return cylinders; } -- cgit v1.2.3-70-g09d2