core: use C++-primitives for g_tag_list

The old code was leaking memory. Use std::unique_ptr<> for
ownership management.

This is still very primitive and divetags are kept during
application lifetime. There should probably be some form
of reference counting. And the taglist should not be global,
but attached to the divelog.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-26 21:06:13 +01:00 committed by bstoeger
parent b320942343
commit 556ecd5a9b
23 changed files with 92 additions and 125 deletions

View file

@ -10,6 +10,7 @@
#include "printoptions.h"
#include "core/divelist.h"
#include "core/selection.h"
#include "core/tag.h"
#include "core/qthelper.h"
#include "core/string-format.h"
@ -552,7 +553,7 @@ QVariant TemplateLayout::getValue(QString list, QString property, const State &s
} else if (property == "notes") {
return formatNotes(d);
} else if (property == "tags") {
return get_taglist_string(d->tag_list);
return QString::fromStdString(taglist_get_tagstring(d->tag_list));
} else if (property == "gas") {
return formatGas(d);
} else if (property == "sac") {