mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 20:15:32 +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),
|
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)
|
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)())
|
InputSourceType type, std::unique_ptr<InputSource> (*factory_function)())
|
||||||
{
|
{
|
||||||
const bool enabled = IsInputSourceEnabled(si, type);
|
const bool enabled = IsInputSourceEnabled(si, type);
|
||||||
|
std::unique_ptr<InputSource>& source = s_input_sources[static_cast<u32>(type)];
|
||||||
if (enabled)
|
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
|
else
|
||||||
{
|
{
|
||||||
std::unique_ptr<InputSource> source(factory_function());
|
source = factory_function();
|
||||||
if (!source->Initialize(si, settings_lock))
|
if (!source || !source->Initialize(si, settings_lock))
|
||||||
{
|
{
|
||||||
ERROR_LOG("Source '{}' failed to initialize.", InputSourceToString(type));
|
ERROR_LOG("Source '{}' failed to initialize.", InputSourceToString(type));
|
||||||
|
if (source)
|
||||||
|
source->Shutdown();
|
||||||
|
source.reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_input_sources[static_cast<u32>(type)] = std::move(source);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (s_input_sources[static_cast<u32>(type)])
|
if (source)
|
||||||
{
|
{
|
||||||
s_input_sources[static_cast<u32>(type)]->Shutdown();
|
source->Shutdown();
|
||||||
s_input_sources[static_cast<u32>(type)].reset();
|
source.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user