Merge pull request #6267 from mahdihijazi/gc_pad_settings
[Android] Fix a bug when you open the gc pad settings after fresh install
This commit is contained in:
commit
bedc814923
|
@ -336,6 +336,11 @@ public final class SettingsFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fileName.equals(SettingsFile.FILE_NAME_DOLPHIN))
|
||||||
|
{
|
||||||
|
addGcPadSettingsIfTheyDontExist(sections);
|
||||||
|
}
|
||||||
|
|
||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,6 +403,23 @@ public final class SettingsFile
|
||||||
return new SettingSection(sectionName);
|
return new SettingSection(sectionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addGcPadSettingsIfTheyDontExist(HashMap<String, SettingSection> sections)
|
||||||
|
{
|
||||||
|
SettingSection coreSection = sections.get(SettingsFile.SECTION_CORE);
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
String key = SettingsFile.KEY_GCPAD_TYPE + i;
|
||||||
|
if (coreSection.getSetting(key) == null)
|
||||||
|
{
|
||||||
|
Setting gcPadSetting = new IntSetting(key, SettingsFile.SECTION_CORE, SettingsFile.SETTINGS_DOLPHIN, 0);
|
||||||
|
coreSection.putSetting(gcPadSetting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sections.put(SettingsFile.SECTION_CORE, coreSection);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For a line of text, determines what type of data is being represented, and returns
|
* For a line of text, determines what type of data is being represented, and returns
|
||||||
* a Setting object containing this data.
|
* a Setting object containing this data.
|
||||||
|
|
Loading…
Reference in New Issue