summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/MainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index ddc09bb825..b1fac6ecf4 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -1705,10 +1705,12 @@ void MainWindow::OnConnectWiiRemote(int id)
if (!ios || SConfig::GetInstance().m_bt_passthrough_enabled)
return;
Core::RunAsCPUThread([&] {
- const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
- ios->GetDeviceByName("/dev/usb/oh1/57e/305"));
- const bool is_connected = bt && bt->AccessWiimoteByIndex(id)->IsConnected();
- Wiimote::Connect(id, !is_connected);
+ if (const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
+ ios->GetDeviceByName("/dev/usb/oh1/57e/305")))
+ {
+ const auto wm = bt->AccessWiimoteByIndex(id);
+ wm->Activate(!wm->IsConnected());
+ }
});
}