Fix various warnings

This commit is contained in:
Joshua Vandaële
2025-06-09 15:30:26 +02:00
parent f76ab86326
commit 06882bd2dc
13 changed files with 40 additions and 32 deletions

View File

@ -309,8 +309,15 @@ void WiimoteControllersWidget::OnBluetoothPassthroughDeviceChanged(int index)
return;
}
auto device_info =
m_bluetooth_adapters->itemData(index).value<LibUSBBluetoothAdapter::BluetoothDeviceInfo>();
const QVariant item_data = m_bluetooth_adapters->itemData(index);
if (!item_data.isValid() || !item_data.canConvert<LibUSBBluetoothAdapter::BluetoothDeviceInfo>())
{
ERROR_LOG_FMT(COMMON, "Invalid Bluetooth device info selected in WiimoteControllersWidget");
return;
}
const auto& device_info = item_data.value<LibUSBBluetoothAdapter::BluetoothDeviceInfo>();
Config::SetBaseOrCurrent(Config::MAIN_BLUETOOTH_PASSTHROUGH_PID, device_info.pid);
Config::SetBaseOrCurrent(Config::MAIN_BLUETOOTH_PASSTHROUGH_VID, device_info.vid);