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
parent 0c45c5279b
commit b20a091e5c
11 changed files with 99 additions and 105 deletions

View file

@ -311,7 +311,7 @@ void OstcFirmwareCheck::checkLatest(QWidget *_parent, device_data_t *data, const
QStringList fwParts = latestFirmwareAvailable.split(".");
int latestFirmwareAvailableNumber;
if (strcmp(data->product, "OSTC 4") == 0) {
if (data->product == "OSTC 4") {
unsigned char X, Y, Z, beta;
X = (firmwareOnDevice & 0xF800) >> 11;
Y = (firmwareOnDevice & 0x07C0) >> 6;
@ -1532,10 +1532,10 @@ void ConfigureDiveComputerDialog::dc_open()
ui.progressBar->setFormat(tr("Connected to device"));
qPrefDiveComputer::set_device(device_data.devname);
qPrefDiveComputer::set_device_name(device_data.btname);
qPrefDiveComputer::set_vendor(device_data.vendor);
qPrefDiveComputer::set_product(device_data.product);
qPrefDiveComputer::set_device(device_data.devname.c_str());
qPrefDiveComputer::set_device_name(device_data.btname.c_str());
qPrefDiveComputer::set_vendor(device_data.vendor.c_str());
qPrefDiveComputer::set_product(device_data.product.c_str());
}
void ConfigureDiveComputerDialog::dc_close()