Merge pull request #647 from dubrovskip/master
Tour settings save format fix
This commit is contained in:
commit
1d0fbad437
2 changed files with 7 additions and 4 deletions
|
@ -110,13 +110,12 @@ public class OsmandSettings {
|
||||||
protected OsmandSettings(OsmandApplication clientContext, SettingsAPI settinsAPI) {
|
protected OsmandSettings(OsmandApplication clientContext, SettingsAPI settinsAPI) {
|
||||||
ctx = clientContext;
|
ctx = clientContext;
|
||||||
this.settingsAPI = settinsAPI;
|
this.settingsAPI = settinsAPI;
|
||||||
|
initPrefs();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initPrefs() {
|
||||||
globalPreferences = settingsAPI.getPreferenceObject(SHARED_PREFERENCES_NAME);
|
globalPreferences = settingsAPI.getPreferenceObject(SHARED_PREFERENCES_NAME);
|
||||||
// start from default settings
|
|
||||||
currentMode = ApplicationMode.DEFAULT;
|
|
||||||
|
|
||||||
defaultProfilePreferences = getProfilePreferences(ApplicationMode.DEFAULT);
|
defaultProfilePreferences = getProfilePreferences(ApplicationMode.DEFAULT);
|
||||||
profilePreferences = defaultProfilePreferences;
|
|
||||||
currentMode = readApplicationMode();
|
currentMode = readApplicationMode();
|
||||||
profilePreferences = getProfilePreferences(currentMode);
|
profilePreferences = getProfilePreferences(currentMode);
|
||||||
}
|
}
|
||||||
|
@ -127,6 +126,7 @@ public class OsmandSettings {
|
||||||
|
|
||||||
public void setSettingsAPI(SettingsAPI settingsAPI) {
|
public void setSettingsAPI(SettingsAPI settingsAPI) {
|
||||||
this.settingsAPI = settingsAPI;
|
this.settingsAPI = settingsAPI;
|
||||||
|
initPrefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsAPI getSettingsAPI() {
|
public SettingsAPI getSettingsAPI() {
|
||||||
|
|
|
@ -113,6 +113,9 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (selectedName == null) {
|
||||||
|
app.getSettings().setSettingsAPI(originalSettings.getSettingsAPI());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.tourPresent = tourPresent;
|
this.tourPresent = tourPresent;
|
||||||
|
|
Loading…
Reference in a new issue