mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
Try to guess the proper inputConfig entry from deviceName if deviceGUID is missing.
This commit is contained in:
parent
3c5fa89eaf
commit
98b17bf246
|
@ -252,7 +252,9 @@ bool InputManager::loadInputConfig(InputConfig* config)
|
|||
if(!root)
|
||||
return false;
|
||||
|
||||
pugi::xml_node configNode = root.find_child_by_attribute("inputConfig", "deviceGUID", getDeviceGUIDString(config->getDeviceId()).c_str());
|
||||
pugi::xml_node configNode = root.find_child_by_attribute("inputConfig", "deviceGUID", config->getDeviceGUIDString().c_str());
|
||||
if(!configNode)
|
||||
configNode = root.find_child_by_attribute("inputConfig", "deviceName", config->getDeviceName().c_str());
|
||||
if(!configNode)
|
||||
return false;
|
||||
|
||||
|
@ -304,6 +306,9 @@ void InputManager::writeDeviceConfig(InputConfig* config)
|
|||
pugi::xml_node oldEntry = root.find_child_by_attribute("inputConfig", "deviceGUID", config->getDeviceGUIDString().c_str());
|
||||
if(oldEntry)
|
||||
root.remove_child(oldEntry);
|
||||
oldEntry = root.find_child_by_attribute("inputConfig", "deviceName", config->getDeviceName().c_str());
|
||||
if(oldEntry)
|
||||
root.remove_child(oldEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue