mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 03:55:33 +00:00
Qt: Fix vibration motor binding not showing some devices
This commit is contained in:
parent
c3ce0eece2
commit
160f1ea8a0
@ -2218,7 +2218,7 @@ void InputDeviceListModel::enumerateDevices()
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(this, "resetLists", Qt::QueuedConnection, Q_ARG(const DeviceList&, new_devices),
|
||||
Q_ARG(const QStringList&, m_vibration_motors));
|
||||
Q_ARG(const QStringList&, new_motors));
|
||||
}
|
||||
|
||||
void InputDeviceListModel::resetLists(const DeviceList& devices, const QStringList& motors)
|
||||
|
@ -2167,30 +2167,32 @@ void InputManager::UpdateInputSourceState(const SettingsInterface& si, std::uniq
|
||||
InputSourceType type, std::unique_ptr<InputSource> (*factory_function)())
|
||||
{
|
||||
const bool enabled = IsInputSourceEnabled(si, type);
|
||||
std::unique_ptr<InputSource>& source = s_input_sources[static_cast<u32>(type)];
|
||||
if (enabled)
|
||||
{
|
||||
if (s_input_sources[static_cast<u32>(type)])
|
||||
if (source)
|
||||
{
|
||||
s_input_sources[static_cast<u32>(type)]->UpdateSettings(si, settings_lock);
|
||||
source->UpdateSettings(si, settings_lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::unique_ptr<InputSource> source(factory_function());
|
||||
if (!source->Initialize(si, settings_lock))
|
||||
source = factory_function();
|
||||
if (!source || !source->Initialize(si, settings_lock))
|
||||
{
|
||||
ERROR_LOG("Source '{}' failed to initialize.", InputSourceToString(type));
|
||||
if (source)
|
||||
source->Shutdown();
|
||||
source.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
s_input_sources[static_cast<u32>(type)] = std::move(source);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s_input_sources[static_cast<u32>(type)])
|
||||
if (source)
|
||||
{
|
||||
s_input_sources[static_cast<u32>(type)]->Shutdown();
|
||||
s_input_sources[static_cast<u32>(type)].reset();
|
||||
source->Shutdown();
|
||||
source.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user