mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn struct dive string data into std::string
Much easier memory management! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2b3d2f1020
commit
3cb04d230b
34 changed files with 208 additions and 313 deletions
|
@ -210,11 +210,10 @@ void put_HTML_quoted(struct membuffer *b, const char *text)
|
|||
void put_HTML_notes(struct membuffer *b, const struct dive *dive, const char *pre, const char *post)
|
||||
{
|
||||
put_string(b, pre);
|
||||
if (dive->notes) {
|
||||
put_HTML_quoted(b, dive->notes);
|
||||
} else {
|
||||
if (!dive->notes.empty())
|
||||
put_HTML_quoted(b, dive->notes.c_str());
|
||||
else
|
||||
put_string(b, "--");
|
||||
}
|
||||
put_string(b, post);
|
||||
}
|
||||
|
||||
|
@ -348,9 +347,9 @@ static void write_one_dive(struct membuffer *b, const struct dive *dive, const c
|
|||
put_HTML_airtemp(b, dive, "\"air\":\"", "\",");
|
||||
put_HTML_watertemp(b, dive, "\"water\":\"", "\"");
|
||||
put_string(b, " },");
|
||||
write_attribute(b, "buddy", dive->buddy, ", ");
|
||||
write_attribute(b, "diveguide", dive->diveguide, ", ");
|
||||
write_attribute(b, "suit", dive->suit, ", ");
|
||||
write_attribute(b, "buddy", dive->buddy.c_str(), ", ");
|
||||
write_attribute(b, "diveguide", dive->diveguide.c_str(), ", ");
|
||||
write_attribute(b, "suit", dive->suit.c_str(), ", ");
|
||||
put_HTML_tags(b, dive, "\"tags\":", ",");
|
||||
if (!list_only) {
|
||||
put_cylinder_HTML(b, dive);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue