mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-19 19:21:27 +00:00
migrate port to vault settings
This commit is contained in:
@@ -106,6 +106,7 @@ public class Settings {
|
||||
this.directories.addAll(json.directories.stream().map(VaultSettings::new).toList());
|
||||
|
||||
migrateLegacySettings(json);
|
||||
migratePortToVaultSettings(json);
|
||||
|
||||
directories.addListener(this::somethingChanged);
|
||||
askedForUpdateCheck.addListener(this::somethingChanged);
|
||||
@@ -130,6 +131,15 @@ public class Settings {
|
||||
lastUpdateCheck.addListener(this::somethingChanged);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void migratePortToVaultSettings(SettingsJson json) {
|
||||
if(json.port != 0){
|
||||
for (VaultSettings vaultSettings : directories) {
|
||||
vaultSettings.port.set(json.port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void migrateLegacySettings(SettingsJson json) {
|
||||
// implicit migration of 1.6.x legacy setting "preferredVolumeImpl":
|
||||
|
||||
@@ -46,6 +46,10 @@ class SettingsJson {
|
||||
@JsonProperty("numTrayNotifications")
|
||||
int numTrayNotifications = Settings.DEFAULT_NUM_TRAY_NOTIFICATIONS;
|
||||
|
||||
@Deprecated(since = "1.10.2")
|
||||
@JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) // WRITE_ONLY means value is "written" into the java object during deserialization. Upvote this: https://github.com/FasterXML/jackson-annotations/issues/233
|
||||
int port;
|
||||
|
||||
@JsonProperty("showMinimizeButton")
|
||||
boolean showMinimizeButton = Settings.DEFAULT_SHOW_MINIMIZE_BUTTON;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user