Commit 98b17bf2 authored by Aloshi's avatar Aloshi

Try to guess the proper inputConfig entry from deviceName if deviceGUID is missing.

parent 3c5fa89e
...@@ -252,7 +252,9 @@ bool InputManager::loadInputConfig(InputConfig* config) ...@@ -252,7 +252,9 @@ bool InputManager::loadInputConfig(InputConfig* config)
if(!root) if(!root)
return false; 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) if(!configNode)
return false; return false;
...@@ -304,6 +306,9 @@ void InputManager::writeDeviceConfig(InputConfig* config) ...@@ -304,6 +306,9 @@ void InputManager::writeDeviceConfig(InputConfig* config)
pugi::xml_node oldEntry = root.find_child_by_attribute("inputConfig", "deviceGUID", config->getDeviceGUIDString().c_str()); pugi::xml_node oldEntry = root.find_child_by_attribute("inputConfig", "deviceGUID", config->getDeviceGUIDString().c_str());
if(oldEntry) if(oldEntry)
root.remove_child(oldEntry); root.remove_child(oldEntry);
oldEntry = root.find_child_by_attribute("inputConfig", "deviceName", config->getDeviceName().c_str());
if(oldEntry)
root.remove_child(oldEntry);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment