core: port tag.c to C++

Let taglist_get_tagstring() return an std::string, since all callers
are C++ anyway.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-10 17:20:59 +01:00 committed by bstoeger
parent 84b7ffafd2
commit 422f693f5b
7 changed files with 47 additions and 66 deletions

View file

@ -1220,10 +1220,8 @@ QStringList get_dive_gas_list(const struct dive *d)
QString get_taglist_string(struct tag_entry *tag_list)
{
char *buffer = taglist_get_tagstring(tag_list);
QString ret = QString::fromUtf8(buffer);
free(buffer);
return ret;
std::string tags = taglist_get_tagstring(tag_list);
return QString::fromStdString(tags);
}
QStringList stringToList(const QString &s)