InputCommon: Make ControllerInterface RegisterDevicesChangedCallback use Common::HookableEvent.

This commit is contained in:
Jordan Woyak
2025-11-05 17:12:56 -06:00
parent 2170080f53
commit ca6d8e1f0b
7 changed files with 27 additions and 36 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ Settings::Settings()
}
});
m_hotplug_callback_handle = g_controller_interface.RegisterDevicesChangedCallback([this] {
m_hotplug_event_hook = g_controller_interface.RegisterDevicesChangedCallback("Settings", [this] {
if (Core::IsHostThread())
{
emit DevicesChanged();
@@ -101,7 +101,7 @@ Settings::~Settings()
void Settings::UnregisterDevicesChangedCallback()
{
g_controller_interface.UnregisterDevicesChangedCallback(m_hotplug_callback_handle);
m_hotplug_event_hook.reset();
}
Settings& Settings::Instance()
+1 -1
View File
@@ -234,7 +234,7 @@ private:
std::shared_ptr<NetPlay::NetPlayClient> m_client;
std::shared_ptr<NetPlay::NetPlayServer> m_server;
ControllerInterface::HotplugCallbackHandle m_hotplug_callback_handle;
Common::EventHook m_hotplug_event_hook;
Config::ConfigChangedCallbackID m_config_changed_callback_id;
};