diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-28 22:45:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 37146c5742503becf75468fb07aab56011cb9101 (patch) | |
tree | 666e4d609b3d9b882082fcc258d6d153c6c68fa5 /core/downloadfromdcthread.cpp | |
parent | 926b6895bbce7cc539ca4d0c3a425876dfa33d6b (diff) | |
download | subsurface-37146c5742503becf75468fb07aab56011cb9101.tar.gz |
Parser: parse into custom dive site table
To extend the undo system to dive sites, the importers and downloaders
must not parse directly into the global dive site table. Instead,
pass a dive_site_table argument to parse into.
For now, always pass the global dive_site_table so that this commit
should not cause any functional change.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r-- | core/downloadfromdcthread.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 03268a0f0..5b336dee5 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -60,6 +60,7 @@ static void updateRememberedDCs() DownloadThread::DownloadThread() : downloadTable({ 0 }), + diveSiteTable({ 0 }), m_data(DCDeviceData::instance()) { } @@ -69,6 +70,7 @@ void DownloadThread::run() auto internalData = m_data->internalData(); internalData->descriptor = descriptorLookup[m_data->vendor() + m_data->product()]; internalData->download_table = &downloadTable; + internalData->sites = &diveSiteTable; internalData->btname = strdup(m_data->devBluetoothName().toUtf8()); if (!internalData->descriptor) { qDebug() << "No download possible when DC type is unknown"; @@ -81,6 +83,7 @@ void DownloadThread::run() #endif qDebug() << "Starting download from " << (internalData->bluetooth_mode ? "BT" : internalData->devname); clear_table(&downloadTable); + clear_dive_site_table(&diveSiteTable); Q_ASSERT(internalData->download_table != nullptr); const char *errorText; |