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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-14 18:11:46 -07:00
parent 1495aa2dbf
commit ec3a968df9
8 changed files with 38 additions and 11 deletions

View file

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