Change taglist_get_tagstring to support 'unlimited' tag list size

Previous taglist_get_tagstring signature/implementation did not allow
handling of cases where inputted buffer could not contain all tags.
New implementation allocates buffer based on pre-computed size allowing to
insert all tags in the returned string.

Added get_taglist_string in qthelper to handle conversion to QString
Added TestTagList with tests for taglist_get_tagstring

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
This commit is contained in:
Jeremie Guichard 2018-04-09 10:09:34 +02:00 committed by Dirk Hohndel
parent f1830cd44e
commit 7753352e62
10 changed files with 140 additions and 39 deletions

View file

@ -192,9 +192,7 @@ QString DiveObjectHelper::notes() const
QString DiveObjectHelper::tags() const
{
static char buffer[256];
taglist_get_tagstring(m_dive->tag_list, buffer, 256);
return QString(buffer);
return get_taglist_string(m_dive->tag_list);
}
QString DiveObjectHelper::gas() const