From 7753352e6210ae69c2a79bdf2387eaca46becc64 Mon Sep 17 00:00:00 2001 From: Jeremie Guichard Date: Mon, 9 Apr 2018 10:09:34 +0200 Subject: 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 --- core/subsurface-qt/DiveObjectHelper.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core/subsurface-qt') diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 093451ad3..4c1c66e21 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -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 -- cgit v1.2.3-70-g09d2