From ec3a968df9d8fc706fedb788959631e2ed84e04b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Mar 2020 18:11:46 -0700 Subject: android/usb: pass in the UsbDevice when downloading This finally allows us to download from not just the first device, but specifically the device that the user picks. Passing the object through a void pointer is not nice - but since this traverses C code other solutions (like passing an index into the list) seemed even worse. Signed-off-by: Dirk Hohndel --- core/downloadfromdcthread.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/downloadfromdcthread.cpp') diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index c71a96fd9..2517b7fb6 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -220,6 +220,9 @@ DCDeviceData::DCDeviceData() #else data.libdc_log = false; #endif +#if defined(Q_OS_ANDROID) + data.androidUsbDeviceDescriptor = nullptr; +#endif } DCDeviceData *DCDeviceData::instance() @@ -320,6 +323,13 @@ void DCDeviceData::setDevName(const QString &devName) data.devname = copy_qstring(devName); } +#if defined(Q_OS_ANDROID) +void DCDeviceData::setUsbDevice(void *device) +{ + data.androidUsbDeviceDescriptor = device; +} +#endif + void DCDeviceData::setDevBluetoothName(const QString &name) { m_devBluetoothName = name; -- cgit v1.2.3-70-g09d2