summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/datatrak.c2
-rw-r--r--core/downloadfromdcthread.cpp2
-rw-r--r--core/downloadfromdcthread.h2
-rw-r--r--core/libdivecomputer.h2
-rw-r--r--qt-models/diveimportedmodel.cpp1
5 files changed, 9 insertions, 0 deletions
diff --git a/core/datatrak.c b/core/datatrak.c
index b10ef55ad..01a16210a 100644
--- a/core/datatrak.c
+++ b/core/datatrak.c
@@ -177,6 +177,8 @@ static unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive
char is_nitrox = 0, is_O2 = 0, is_SCR = 0;
device_data_t *devdata = calloc(1, sizeof(device_data_t));
+ devdata->sites = sites;
+ devdata->devices = devices;
/*
* Parse byte to byte till next dive entry
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp
index 0ba4433eb..44120894e 100644
--- a/core/downloadfromdcthread.cpp
+++ b/core/downloadfromdcthread.cpp
@@ -92,6 +92,7 @@ void DownloadThread::run()
internalData->descriptor = descriptorLookup[m_data->vendor().toLower() + m_data->product().toLower()];
internalData->download_table = &downloadTable;
internalData->sites = &diveSiteTable;
+ internalData->devices = &deviceTable;
internalData->btname = strdup(m_data->devBluetoothName().toUtf8());
if (!internalData->descriptor) {
qDebug() << "No download possible when DC type is unknown";
@@ -110,6 +111,7 @@ void DownloadThread::run()
qDebug() << "downloading" << (internalData->force_download ? "all" : "only new") << "dives";
clear_dive_table(&downloadTable);
clear_dive_site_table(&diveSiteTable);
+ clear_device_table(&deviceTable);
Q_ASSERT(internalData->download_table != nullptr);
const char *errorText;
diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h
index 239811749..8f11fb7cc 100644
--- a/core/downloadfromdcthread.h
+++ b/core/downloadfromdcthread.h
@@ -7,6 +7,7 @@
#include <QLoggingCategory>
#include "divesite.h"
+#include "device.h"
#include "libdivecomputer.h"
#include "connectionlistmodel.h"
#if BT_SUPPORT
@@ -77,6 +78,7 @@ public:
QString error;
struct dive_table downloadTable;
struct dive_site_table diveSiteTable;
+ struct device_table deviceTable;
private:
DCDeviceData *m_data;
diff --git a/core/libdivecomputer.h b/core/libdivecomputer.h
index 9e3fbf1ef..9932c9d84 100644
--- a/core/libdivecomputer.h
+++ b/core/libdivecomputer.h
@@ -28,6 +28,7 @@ extern "C" {
struct dive;
struct dive_computer;
+struct devices;
typedef struct {
dc_descriptor_t *descriptor;
@@ -47,6 +48,7 @@ typedef struct {
FILE *libdc_logfile;
struct dive_table *download_table;
struct dive_site_table *sites;
+ struct device_table *devices;
void *androidUsbDeviceDescriptor;
} device_data_t;
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp
index 0541d32d3..0e2c07cc6 100644
--- a/qt-models/diveimportedmodel.cpp
+++ b/qt-models/diveimportedmodel.cpp
@@ -129,6 +129,7 @@ void DiveImportedModel::downloadThreadFinished()
// Move the table data from thread to model
move_dive_table(&thread.downloadTable, &diveTable);
move_dive_site_table(&thread.diveSiteTable, &sitesTable);
+ deviceTable = std::move(thread.deviceTable);
checkStates.resize(diveTable.nr);
std::fill(checkStates.begin(), checkStates.end(), true);