Android SettingsFragmentParser - remove ad-hoc SettingSection construction
Now the SettingsSection map constructs a new SettingsSection at .get() time, these are no longer needed
This commit is contained in:
parent
221462808d
commit
3f247eefae
|
@ -181,8 +181,6 @@ public final class SettingsFragmentPresenter
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mSettings.get(SettingsFile.SETTINGS_DOLPHIN).put(SettingsFile.SECTION_CORE, new SettingSection(SettingsFile.SECTION_CORE));
|
|
||||||
|
|
||||||
mView.passSettingsToActivity(mSettings);
|
mView.passSettingsToActivity(mSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,17 +251,11 @@ public final class SettingsFragmentPresenter
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mSettings.get(SettingsFile.SETTINGS_GFX).put(SettingsFile.SECTION_GFX_SETTINGS, new SettingSection(SettingsFile.SECTION_GFX_SETTINGS));
|
|
||||||
mSettings.get(SettingsFile.SETTINGS_GFX).put(SettingsFile.SECTION_GFX_ENHANCEMENTS, new SettingSection(SettingsFile.SECTION_GFX_ENHANCEMENTS));
|
|
||||||
mSettings.get(SettingsFile.SETTINGS_GFX).put(SettingsFile.SECTION_GFX_HACKS, new SettingSection(SettingsFile.SECTION_GFX_HACKS));
|
|
||||||
|
|
||||||
mView.passSettingsToActivity(mSettings);
|
mView.passSettingsToActivity(mSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
if (mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
||||||
{
|
{
|
||||||
mSettings.get(SettingsFile.SETTINGS_DOLPHIN).put(SettingsFile.SECTION_CORE, new SettingSection(SettingsFile.SECTION_CORE));
|
|
||||||
|
|
||||||
mView.passSettingsToActivity(mSettings);
|
mView.passSettingsToActivity(mSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,12 +339,8 @@ public final class SettingsFragmentPresenter
|
||||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.aspect_ratio, R.string.aspect_ratio_descrip, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio));
|
sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.aspect_ratio, R.string.aspect_ratio_descrip, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addStereoSettings(ArrayList<SettingsItem> sl) {
|
private void addStereoSettings(ArrayList<SettingsItem> sl)
|
||||||
if (mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY) == null)
|
{
|
||||||
{
|
|
||||||
mSettings.get(SettingsFile.SETTINGS_GFX).put(SettingsFile.SECTION_STEREOSCOPY, new SettingSection(SettingsFile.SECTION_STEREOSCOPY));
|
|
||||||
}
|
|
||||||
|
|
||||||
Setting stereoModeValue = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_MODE);
|
Setting stereoModeValue = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_MODE);
|
||||||
Setting stereoDepth = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_DEPTH);
|
Setting stereoDepth = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_DEPTH);
|
||||||
Setting convergence = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_CONV);
|
Setting convergence = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_CONV);
|
||||||
|
@ -414,8 +402,6 @@ public final class SettingsFragmentPresenter
|
||||||
}
|
}
|
||||||
catch (NullPointerException ex)
|
catch (NullPointerException ex)
|
||||||
{
|
{
|
||||||
mSettings.get(SettingsFile.SETTINGS_DOLPHIN).put(SettingsFile.SECTION_BINDINGS, new SettingSection(SettingsFile.SECTION_BINDINGS));
|
|
||||||
|
|
||||||
mView.passSettingsToActivity(mSettings);
|
mView.passSettingsToActivity(mSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,8 +520,6 @@ public final class SettingsFragmentPresenter
|
||||||
}
|
}
|
||||||
catch (NullPointerException ex)
|
catch (NullPointerException ex)
|
||||||
{
|
{
|
||||||
mSettings.get(SettingsFile.SETTINGS_DOLPHIN).put(SettingsFile.SECTION_BINDINGS, new SettingSection(SettingsFile.SECTION_BINDINGS));
|
|
||||||
|
|
||||||
mView.passSettingsToActivity(mSettings);
|
mView.passSettingsToActivity(mSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue