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 <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2017-05-26 14:07:02 +02:00 committed by Dirk Hohndel
parent c370b876b2
commit 85e92597b5
2 changed files with 2 additions and 6 deletions

View file

@ -1,5 +1,6 @@
#include "downloadfromdcthread.h"
#include "core/libdivecomputer.h"
#include <QDebug>
QStringList vendorList;
QHash<QString, QStringList> 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;

View file

@ -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);