From 6fd1e32452a9d3d1fb7116764442bbd26d36673e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 15 Jun 2013 14:48:31 -1000 Subject: Properly initialize device_data_t when downloading The old gtk branch started out with device_data_t explicitly cleared, but the Qt version never did that. And we actually depend on the deviceid in particular being initialized to zero (and then we fill in the details in the divecomputer download callbacks) Not properly initializing it meant that we ended up with random deviceid's that got added to the divecomputer device lists, and then saved to the XML file without actually matching the data in the dive computers in the actual *dives*. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-ui/downloadfromdivecomputer.cpp') diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index b0bdea739..37ca2775b 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -157,6 +157,7 @@ void DownloadFromDCWidget::on_ok_clicked() data.product = strdup(ui->product->currentText().toUtf8().data()); data.descriptor = descriptorLookup[ui->vendor->currentText() + ui->product->currentText()]; data.force_download = ui->forceDownload->isChecked(); + data.deviceid = data.diveid = 0; set_default_dive_computer(data.vendor, data.product); set_default_dive_computer_device(data.devname); -- cgit v1.2.3-70-g09d2