import: turn C-string in device_data_t into std::strings

It was never clear what was a pointer to a static string from
libdivecomputer and what was allocated.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-02 21:26:22 +02:00 committed by bstoeger
parent 0915c1ce43
commit 01306224ff
15 changed files with 120 additions and 129 deletions

View file

@ -68,16 +68,14 @@ static QString writeGasDetails(gas g)
bool ConfigureDiveComputer::saveXMLBackup(const QString &fileName, const DeviceDetails &details, device_data_t *data)
{
QString xml = "";
QString vendor = data->vendor;
QString product = data->product;
QXmlStreamWriter writer(&xml);
writer.setAutoFormatting(true);
writer.writeStartDocument();
writer.writeStartElement("DiveComputerSettingsBackup");
writer.writeStartElement("DiveComputer");
writer.writeTextElement("Vendor", vendor);
writer.writeTextElement("Product", product);
writer.writeTextElement("Vendor", QString::fromStdString(data->vendor));
writer.writeTextElement("Product", QString::fromStdString(data->product));
writer.writeEndElement();
writer.writeStartElement("Settings");
writer.writeTextElement("CustomText", details.customText);