diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-01-13 10:58:04 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-19 13:48:17 -0800 |
commit | ff9506b21bbb9910256841dcb577bcb2e19047e8 (patch) | |
tree | c0bfa63b27ca32fc6d8c223531d5beff6fbb95fe /core/downloadfromdcthread.cpp | |
parent | 1cd0863cca678cf54dfa8a71f3ca9f94bfc4f693 (diff) | |
download | subsurface-ff9506b21bbb9910256841dcb577bcb2e19047e8.tar.gz |
Import: don't add to new trip while downloading
Since process_imported_dives() can add dives to a newly generated
trip, this need not be done in the downloading code. This makes
data flow distinctly simpler, as no trip table and no add-new-trip
flag has to be passed down to the libdivecomputer glue code.
Moreover, since now the trip creation is done at the import step
rather than the download step, the latest status of the "add to
new trip" checkbox will be considered.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r-- | core/downloadfromdcthread.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 0774c5e8b..97e04c48b 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -60,7 +60,6 @@ static void updateRememberedDCs() DownloadThread::DownloadThread() : downloadTable({ 0 }), - tripTable({ 0 }), m_data(DCDeviceData::instance()) { } @@ -70,7 +69,6 @@ void DownloadThread::run() auto internalData = m_data->internalData(); internalData->descriptor = descriptorLookup[m_data->vendor() + m_data->product()]; internalData->download_table = &downloadTable; - internalData->trip_table = &tripTable; internalData->btname = strdup(m_data->devBluetoothName().toUtf8()); if (!internalData->descriptor) { qDebug() << "No download possible when DC type is unknown"; @@ -83,10 +81,6 @@ void DownloadThread::run() #endif qDebug() << "Starting download from " << (internalData->bluetooth_mode ? "BT" : internalData->devname); clear_table(&downloadTable); - if (tripTable.nr > 0) { - qWarning() << "DownloadThread::run(): Trip table not empty after reset"; - tripTable.nr = 0; - } Q_ASSERT(internalData->download_table != nullptr); const char *errorText; @@ -265,7 +259,6 @@ DCDeviceData::DCDeviceData() memset(&data, 0, sizeof(data)); data.trip = nullptr; data.download_table = nullptr; - data.trip_table = nullptr; data.diveid = 0; data.deviceid = 0; #if defined(BT_SUPPORT) @@ -274,7 +267,6 @@ DCDeviceData::DCDeviceData() data.bluetooth_mode = false; #endif data.force_download = false; - data.create_new_trip = false; data.libdc_dump = false; #if defined(SUBSURFACE_MOBILE) data.libdc_log = true; @@ -314,11 +306,6 @@ struct dive_table *DownloadThread::table() return &downloadTable; } -struct trip_table *DownloadThread::trips() -{ - return &tripTable; -} - QString DCDeviceData::vendor() const { return data.vendor; @@ -354,11 +341,6 @@ bool DCDeviceData::forceDownload() const return data.force_download; } -bool DCDeviceData::createNewTrip() const -{ - return data.create_new_trip; -} - int DCDeviceData::deviceId() const { return data.deviceid; @@ -415,11 +397,6 @@ void DCDeviceData::setForceDownload(bool force) data.force_download = force; } -void DCDeviceData::setCreateNewTrip(bool create) -{ - data.create_new_trip = create; -} - void DCDeviceData::setDeviceId(int deviceId) { data.deviceid = deviceId; |