diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-10-19 19:19:32 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-24 09:51:37 -0700 |
commit | 2bcb3d88a090582d6d3dcda8810f011beb22caa6 (patch) | |
tree | fb3df1386b99df63d3ea528b997f31e959b118f9 /core/downloadfromdcthread.cpp | |
parent | 5a19437311231aed114de8da75e19f94ac04f5aa (diff) | |
download | subsurface-2bcb3d88a090582d6d3dcda8810f011beb22caa6.tar.gz |
divecomputer: add device_table pointer to device_data_t
In one weird case (suunto), the code in libdivecomputer.c
generates a device node directly instead of going the usual
way (setting the data in the dc-structure of the imported
dive). It is unclear to me whether that has to be that way,
as it depends on the chronological order of callbacks to
event_cb() and dive_cb().
Therefore add a device_table pointer to device_data_t
so that the downloader can add the device to this table. This
only adds the pointer, but does not yet use it in the
downloading code.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r-- | core/downloadfromdcthread.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; |