Rename 'IdentitySettings' to 'IdentitySettingsDescriptions'

This commit is contained in:
cketti 2020-04-10 01:42:34 +02:00
parent c5195890a1
commit 6fba5f8e6a
3 changed files with 7 additions and 7 deletions

View file

@ -18,7 +18,7 @@ import com.fsck.k9.preferences.Settings.SettingsUpgrader;
import com.fsck.k9.preferences.Settings.V;
class IdentitySettings {
class IdentitySettingsDescriptions {
static final Map<String, TreeMap<Integer, SettingsDescription>> SETTINGS;
private static final Map<Integer, SettingsUpgrader> UPGRADERS;

View file

@ -303,7 +303,7 @@ class SettingsExporter(
continue
}
val versionedSetting = IdentitySettings.SETTINGS[identityKey]
val versionedSetting = IdentitySettingsDescriptions.SETTINGS[identityKey]
if (versionedSetting != null) {
val highestVersion = versionedSetting.lastKey()
val setting = versionedSetting[highestVersion]

View file

@ -551,7 +551,7 @@ public class SettingsImporter {
putString(editor, accountKeyPrefix + AccountPreferenceSerializer.IDENTITY_NAME_KEY + identitySuffix, identityName);
// Validate email address
if (!IdentitySettings.isEmailAddressValid(identity.email)) {
if (!IdentitySettingsDescriptions.isEmailAddressValid(identity.email)) {
throw new InvalidSettingValueException();
}
@ -564,21 +564,21 @@ public class SettingsImporter {
if (identity.settings != null) {
// Validate identity settings
Map<String, Object> validatedSettings = IdentitySettings.validate(
Map<String, Object> validatedSettings = IdentitySettingsDescriptions.validate(
contentVersion, identity.settings.settings, !mergeSettings);
// Upgrade identity settings to current content version
if (contentVersion != Settings.VERSION) {
IdentitySettings.upgrade(contentVersion, validatedSettings);
IdentitySettingsDescriptions.upgrade(contentVersion, validatedSettings);
}
// Convert identity settings to the representation used in preference storage
Map<String, String> stringSettings = IdentitySettings.convert(validatedSettings);
Map<String, String> stringSettings = IdentitySettingsDescriptions.convert(validatedSettings);
// Merge identity settings if necessary
Map<String, String> writeSettings;
if (mergeSettings) {
writeSettings = new HashMap<>(IdentitySettings.getIdentitySettings(
writeSettings = new HashMap<>(IdentitySettingsDescriptions.getIdentitySettings(
prefs.getStorage(), uuid, writeIdentityIndex));
writeSettings.putAll(stringSettings);
} else {