Loading app/core/src/main/java/com/fsck/k9/preferences/AccountSettings.java +38 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import com.fsck.k9.Account.QuoteStyle; import com.fsck.k9.Account.Searchable; import com.fsck.k9.Account.ShowPictures; import com.fsck.k9.Account.SortType; import com.fsck.k9.Account.SpecialFolderSelection; import com.fsck.k9.DI; import com.fsck.k9.K9; import com.fsck.k9.core.R; Loading Loading @@ -244,6 +245,21 @@ public class AccountSettings { s.put("uploadSentMessages", Settings.versions( new V(52, new BooleanSetting(true)) )); s.put("archiveFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("draftsFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("sentFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("spamFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("trashFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); // note that there is no setting for openPgpProvider, because this will have to be set up together // with the actual provider after import anyways. Loading @@ -251,6 +267,7 @@ public class AccountSettings { Map<Integer, SettingsUpgrader> u = new HashMap<>(); u.put(53, new SettingsUpgraderV53()); u.put(54, new SettingsUpgraderV54()); UPGRADERS = Collections.unmodifiableMap(u); } Loading Loading @@ -431,4 +448,24 @@ public class AccountSettings { } } } /** * Upgrades settings from version 53 to 54 * * Inserts folder selection entries with a value of "MANUAL" */ private static class SettingsUpgraderV54 implements SettingsUpgrader { private static final String FOLDER_SELECTION_MANUAL = "MANUAL"; @Override public Set<String> upgrade(Map<String, Object> settings) { settings.put("archiveFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("draftsFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("sentFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("spamFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("trashFolderSelection", FOLDER_SELECTION_MANUAL); return null; } } } app/core/src/main/java/com/fsck/k9/preferences/Settings.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public class Settings { * * @see SettingsExporter */ public static final int VERSION = 53; public static final int VERSION = 54; static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings, Map<String, String> importedSettings, boolean useDefaultValues) { Loading Loading
app/core/src/main/java/com/fsck/k9/preferences/AccountSettings.java +38 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import com.fsck.k9.Account.QuoteStyle; import com.fsck.k9.Account.Searchable; import com.fsck.k9.Account.ShowPictures; import com.fsck.k9.Account.SortType; import com.fsck.k9.Account.SpecialFolderSelection; import com.fsck.k9.DI; import com.fsck.k9.K9; import com.fsck.k9.core.R; Loading Loading @@ -244,6 +245,21 @@ public class AccountSettings { s.put("uploadSentMessages", Settings.versions( new V(52, new BooleanSetting(true)) )); s.put("archiveFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("draftsFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("sentFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("spamFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); s.put("trashFolderSelection", Settings.versions( new V(54, new EnumSetting<>(SpecialFolderSelection.class, SpecialFolderSelection.AUTOMATIC)) )); // note that there is no setting for openPgpProvider, because this will have to be set up together // with the actual provider after import anyways. Loading @@ -251,6 +267,7 @@ public class AccountSettings { Map<Integer, SettingsUpgrader> u = new HashMap<>(); u.put(53, new SettingsUpgraderV53()); u.put(54, new SettingsUpgraderV54()); UPGRADERS = Collections.unmodifiableMap(u); } Loading Loading @@ -431,4 +448,24 @@ public class AccountSettings { } } } /** * Upgrades settings from version 53 to 54 * * Inserts folder selection entries with a value of "MANUAL" */ private static class SettingsUpgraderV54 implements SettingsUpgrader { private static final String FOLDER_SELECTION_MANUAL = "MANUAL"; @Override public Set<String> upgrade(Map<String, Object> settings) { settings.put("archiveFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("draftsFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("sentFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("spamFolderSelection", FOLDER_SELECTION_MANUAL); settings.put("trashFolderSelection", FOLDER_SELECTION_MANUAL); return null; } } }
app/core/src/main/java/com/fsck/k9/preferences/Settings.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public class Settings { * * @see SettingsExporter */ public static final int VERSION = 53; public static final int VERSION = 54; static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings, Map<String, String> importedSettings, boolean useDefaultValues) { Loading