diff --git a/libnymea-app/wifisetup/bluetoothdeviceinfos.cpp b/libnymea-app/wifisetup/bluetoothdeviceinfos.cpp index 38fe20b1..d13d2bfc 100644 --- a/libnymea-app/wifisetup/bluetoothdeviceinfos.cpp +++ b/libnymea-app/wifisetup/bluetoothdeviceinfos.cpp @@ -87,6 +87,11 @@ void BluetoothDeviceInfos::addBluetoothDeviceInfo(BluetoothDeviceInfo *deviceInf deviceInfo->setParent(this); beginInsertRows(QModelIndex(), m_deviceInfos.count(), m_deviceInfos.count()); m_deviceInfos.append(deviceInfo); + connect(deviceInfo, &BluetoothDeviceInfo::deviceChanged, this, [=]{ + int idx = m_deviceInfos.indexOf(deviceInfo); + QModelIndex index = this->index(idx); + emit dataChanged(index, index); + }); endInsertRows(); emit countChanged(); } diff --git a/libnymea-app/wifisetup/bluetoothdiscovery.cpp b/libnymea-app/wifisetup/bluetoothdiscovery.cpp index 10ec26ba..1594ee19 100644 --- a/libnymea-app/wifisetup/bluetoothdiscovery.cpp +++ b/libnymea-app/wifisetup/bluetoothdiscovery.cpp @@ -178,18 +178,20 @@ void BluetoothDiscovery::onBluetoothHostModeChanged(const QBluetoothLocalDevice: void BluetoothDiscovery::deviceDiscovered(const QBluetoothDeviceInfo &deviceInfo) { - qCDebug(dcBtWiFiSetup()) << "BluetoothDiscovery: Device discovered:" << deviceInfo.name() << deviceInfo.address().toString() << deviceInfo.deviceUuid(); + qCDebug(dcBtWiFiSetup()) << "BluetoothDiscovery: Device discovered:" << deviceInfo.name() << deviceInfo.address().toString() << deviceInfo.deviceUuid() << deviceInfo.serviceUuids(); foreach (BluetoothDeviceInfo *di, m_deviceInfos->deviceInfos()) { // Some platforms only provide device UUID (e.g. Apple) and MAC address is 00:00:00:00:00 // Others provide only a MAC address and the UUID is null. // If we have a UUID, use that, otherwise use the MAC for comparison if (!deviceInfo.deviceUuid().isNull()) { if (di->bluetoothDeviceInfo().deviceUuid() == deviceInfo.deviceUuid()) { + qCDebug(dcBtWiFiSetup()) << "Updating discovery result (UUID)"; di->setBluetoothDeviceInfo(deviceInfo); return; } } else { if (di->bluetoothDeviceInfo().address() == deviceInfo.address()) { + qCDebug(dcBtWiFiSetup()) << "Updating discovery result (MAC)"; di->setBluetoothDeviceInfo(deviceInfo); return; }