mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +00:00
Merge pull request #6166 from ligfx/invokedeviceschangedcallbacks
ControllerInterface: cleanup callbacks API and logic
This commit is contained in:
commit
4733bbd8f3
10 changed files with 78 additions and 50 deletions
|
@ -92,9 +92,7 @@ static void HotplugThreadFunc()
|
|||
g_controller_interface.RemoveDevice([&name](const auto& device) {
|
||||
return device->GetSource() == "evdev" && device->GetName() == name && !device->IsValid();
|
||||
});
|
||||
NOTICE_LOG(SERIALINTERFACE, "Removed device: %s", name.c_str());
|
||||
s_devnode_name_map.erase(devnode);
|
||||
g_controller_interface.InvokeHotplugCallbacks();
|
||||
}
|
||||
// Only react to "device added" events for evdev devices that we can access.
|
||||
else if (strcmp(action, "add") == 0 && access(devnode, W_OK) == 0)
|
||||
|
@ -107,8 +105,6 @@ static void HotplugThreadFunc()
|
|||
{
|
||||
g_controller_interface.AddDevice(std::move(device));
|
||||
s_devnode_name_map.insert(std::pair<std::string, std::string>(devnode, name));
|
||||
NOTICE_LOG(SERIALINTERFACE, "Added new device: %s", name.c_str());
|
||||
g_controller_interface.InvokeHotplugCallbacks();
|
||||
}
|
||||
}
|
||||
udev_device_unref(dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue