aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/divesitehelpers.cpp1
-rw-r--r--core/qthelper.cpp1
-rw-r--r--core/uploadDiveLogsDE.cpp9
-rw-r--r--core/uploadDiveShare.cpp3
4 files changed, 4 insertions, 10 deletions
diff --git a/core/divesitehelpers.cpp b/core/divesitehelpers.cpp
index bb4764274..5a36d63ca 100644
--- a/core/divesitehelpers.cpp
+++ b/core/divesitehelpers.cpp
@@ -9,7 +9,6 @@
#include "errorhelper.h"
#include "subsurface-string.h"
#include "qthelper.h"
-#include "membuffer.h"
#include <QDebug>
#include <QJsonDocument>
#include <QJsonArray>
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 185e46bbc..d14276031 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -7,7 +7,6 @@
#include "subsurface-string.h"
#include "gettextfromc.h"
#include "statistics.h"
-#include "membuffer.h"
#include "version.h"
#include "errorhelper.h"
#include "planner.h"
diff --git a/core/uploadDiveLogsDE.cpp b/core/uploadDiveLogsDE.cpp
index 6dc764ed1..980800149 100644
--- a/core/uploadDiveLogsDE.cpp
+++ b/core/uploadDiveLogsDE.cpp
@@ -97,7 +97,7 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected)
const char *membuf;
xmlDoc *transformed;
struct zip_source *s;
- struct membuffer mb = {};
+ struct membufferpp mb;
struct xml_params *params = alloc_xml_params();
/*
@@ -109,9 +109,7 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected)
continue;
}
- /* make sure the buffer is empty and add the dive */
- mb.len = 0;
-
+ /* add the dive */
struct dive_site *ds = dive->dive_site;
if (ds) {
@@ -140,7 +138,7 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected)
put_format(&mb, "</divelog>\n");
}
membuf = mb_cstring(&mb);
- streamsize = strlen(membuf);
+ streamsize = mb.len;
/*
* Parse the memory buffer into XML document and
* transform it to divelogs.de format, finally dumping
@@ -156,7 +154,6 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected)
free_xml_params(params);
return false;
}
- free_buffer(&mb);
xml_params_add_int(params, "allcylinders", prefs.display_unused_tanks);
transformed = xsltApplyStylesheet(xslt, doc, xml_params_get(params));
diff --git a/core/uploadDiveShare.cpp b/core/uploadDiveShare.cpp
index 8d5858e00..87c3d0b24 100644
--- a/core/uploadDiveShare.cpp
+++ b/core/uploadDiveShare.cpp
@@ -27,10 +27,9 @@ uploadDiveShare::uploadDiveShare():
void uploadDiveShare::doUpload(bool selected, const QString &uid, bool noPublic)
{
//generate json
- struct membuffer buf = {};
+ struct membufferpp buf;
export_list(&buf, NULL, selected, false);
QByteArray json_data(buf.buffer, buf.len);
- free_buffer(&buf);
//Request to server
QNetworkRequest request;