mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
b320942343
commit
556ecd5a9b
23 changed files with 92 additions and 125 deletions
|
@ -294,7 +294,7 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
|
|||
case MobileListModel::SumWeightRole: return formatSumWeight(d);
|
||||
case MobileListModel::DiveGuideRole: return QString(d->diveguide);
|
||||
case MobileListModel::BuddyRole: return QString(d->buddy);
|
||||
case MobileListModel::TagsRole: return get_taglist_string(d->tag_list);
|
||||
case MobileListModel::TagsRole: return QString::fromStdString(taglist_get_tagstring(d->tag_list));
|
||||
case MobileListModel::NotesRole: return formatNotes(d);
|
||||
case MobileListModel::GpsRole: return formatDiveGPS(d);
|
||||
case MobileListModel::GpsDecimalRole: return format_gps_decimal(d);
|
||||
|
@ -347,7 +347,7 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
|
|||
else
|
||||
return d->maxcns;
|
||||
case TAGS:
|
||||
return get_taglist_string(d->tag_list);
|
||||
return QString::fromStdString(taglist_get_tagstring(d->tag_list));
|
||||
case PHOTOS:
|
||||
break;
|
||||
case COUNTRY:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue