mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fix various warnings
This commit is contained in:
@ -531,7 +531,7 @@ void CheatSearchWidget::GenerateARCodes()
|
||||
return;
|
||||
|
||||
bool had_success = false;
|
||||
bool had_error = false;
|
||||
bool had_multiple_errors = false;
|
||||
std::optional<Cheats::GenerateActionReplayCodeErrorCode> error_code;
|
||||
|
||||
for (auto* const item : m_address_table->selectedItems())
|
||||
@ -546,23 +546,24 @@ void CheatSearchWidget::GenerateARCodes()
|
||||
else
|
||||
{
|
||||
const auto new_error_code = result.Error();
|
||||
if (!had_error)
|
||||
if (!error_code.has_value())
|
||||
{
|
||||
error_code = new_error_code;
|
||||
}
|
||||
else if (error_code != new_error_code)
|
||||
{
|
||||
// If we have a different error code signify multiple errors with an empty optional<>.
|
||||
error_code.reset();
|
||||
had_multiple_errors = true;
|
||||
}
|
||||
|
||||
had_error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (had_error)
|
||||
if (error_code.has_value())
|
||||
{
|
||||
if (error_code.has_value())
|
||||
if (had_multiple_errors)
|
||||
{
|
||||
m_info_label_1->setText(tr("Multiple errors occurred while generating AR codes."));
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (*error_code)
|
||||
{
|
||||
@ -577,10 +578,6 @@ void CheatSearchWidget::GenerateARCodes()
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_info_label_1->setText(tr("Multiple errors while generating AR codes."));
|
||||
}
|
||||
}
|
||||
else if (had_success)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user