From 85e92597b561f349d24f2181e763c6ed381654ce Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 26 May 2017 14:07:02 +0200 Subject: Set descriptor when starting thread. Set the descriptor when starting the thread, this removes code from the desktop code and makes everything in sync always. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- core/downloadfromdcthread.cpp | 7 ++----- core/downloadfromdcthread.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index e90481a0b..46adbe54c 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -1,5 +1,6 @@ #include "downloadfromdcthread.h" #include "core/libdivecomputer.h" +#include QStringList vendorList; QHash productList; @@ -27,6 +28,7 @@ void DownloadThread::setDiveTable(struct dive_table* table) void DownloadThread::run() { auto internalData = m_data.internalData(); + internalData->descriptor = descriptorLookup[m_data.vendor() + m_data.product()]; Q_ASSERT(internalData->download_table != nullptr); const char *errorText; import_thread_cancelled = false; @@ -159,11 +161,6 @@ void DCDeviceData::setDevName(const QString& devName) data.devname = strdup(qPrintable(devName)); } -void DCDeviceData::setDescriptor(const QString& descriptor) -{ - // data.descriptor = -} - void DCDeviceData::setBluetoothMode(bool mode) { data.bluetooth_mode = mode; diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index d2c3408f2..b20fe17a6 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -47,7 +47,6 @@ public slots: void setVendor(const QString& vendor); void setProduct(const QString& product); void setDevName(const QString& devName); - void setDescriptor(const QString& descriptor); void setBluetoothMode(bool mode); void setForceDownload(bool force); void setCreateNewTrip(bool create); -- cgit v1.2.3-70-g09d2