From 37146c5742503becf75468fb07aab56011cb9101 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 28 Feb 2019 22:45:17 +0100 Subject: 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 --- core/downloadfromdcthread.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/downloadfromdcthread.cpp') 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; -- cgit v1.2.3-70-g09d2