diff options
| author | JosJuice <josjuice@gmail.com> | 2021-12-09 22:20:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-09 22:20:55 +0100 |
| commit | e0a61ed9a0e00eec7e1e30b3df1499f90b6dd3b7 (patch) | |
| tree | 0ac8e4103ced709c92d93db22a2dad850cc0b64f /Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp | |
| parent | d5d21c6533ff2709b9cdf357b0569f3418264812 (diff) | |
| parent | 125971d9f2cbfff81985610a750364a54c3d452d (diff) | |
Merge pull request #10248 from Filoppi/fix_input_config_default_device_load
Fix default input config default device not being loaded/found
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp index 3d224b3cf4..4e46179fc6 100644 --- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp +++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp @@ -258,10 +258,18 @@ std::vector<std::string> DeviceContainer::GetAllDeviceStrings() const return device_strings; } +bool DeviceContainer::HasDefaultDevice() const +{ + std::lock_guard lk(m_devices_mutex); + // Devices are already sorted by priority + return !m_devices.empty() && m_devices[0]->GetSortPriority() >= 0; +} + std::string DeviceContainer::GetDefaultDeviceString() const { std::lock_guard lk(m_devices_mutex); - if (m_devices.empty()) + // Devices are already sorted by priority + if (m_devices.empty() || m_devices[0]->GetSortPriority() < 0) return ""; DeviceQualifier device_qualifier; |
