Fetch updated gamepad mappings each launch

This commit is contained in:
Cameron Gutman 2020-11-21 14:45:34 -06:00
commit e224a7f0c7
7 changed files with 106 additions and 1 deletions

View file

@ -10,10 +10,18 @@
#define SER_GUID "guid"
#define SER_MAPPING "mapping"
MappingFetcher* MappingManager::s_MappingFetcher;
MappingManager::MappingManager()
{
QSettings settings;
// Load updated mappings from the Internet once per Moonlight launch
if (s_MappingFetcher == nullptr) {
s_MappingFetcher = new MappingFetcher();
s_MappingFetcher->start();
}
// First load existing saved mappings. This ensures the user's
// hints can always override the old data.
int mappingCount = settings.beginReadArray(SER_GAMEPADMAPPING);