EmulatedController: encapsulate default device behind getters/setters

This commit is contained in:
Michael M
2017-11-04 14:08:26 -07:00
parent bb0794715c
commit 1b1dd1d749
8 changed files with 52 additions and 40 deletions

View File

@ -211,7 +211,7 @@ void MappingWindow::OnDeviceChanged(int index)
{
const auto device = m_devices_combo->currentText().toStdString();
m_devq.FromString(device);
m_controller->default_device.FromString(device);
m_controller->SetDefaultDevice(device);
}
void MappingWindow::RefreshDevices()
@ -221,9 +221,8 @@ void MappingWindow::RefreshDevices()
Core::RunAsCPUThread([&] {
g_controller_interface.RefreshDevices();
m_controller->UpdateReferences(g_controller_interface);
m_controller->UpdateDefaultDevice();
const auto default_device = m_controller->default_device.ToString();
const auto default_device = m_controller->GetDefaultDevice().ToString();
m_devices_combo->addItem(QString::fromStdString(default_device));