Fix some settings not properly restored

This commit is contained in:
Thomas 2023-03-09 14:17:29 +01:00
parent ca3142046b
commit 8c74343843
1 changed files with 8 additions and 0 deletions

View File

@ -43,6 +43,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream; import java.io.ObjectOutputStream;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import java.util.Date; import java.util.Date;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream; import java.util.zip.ZipInputStream;
@ -245,6 +246,7 @@ public class ZipHelper {
for (Map.Entry<String, ?> entry : entries.entrySet()) { for (Map.Entry<String, ?> entry : entries.entrySet()) {
Object v = entry.getValue(); Object v = entry.getValue();
String key = entry.getKey(); String key = entry.getKey();
if (v instanceof Boolean) if (v instanceof Boolean)
prefEdit.putBoolean(key, ((Boolean) v).booleanValue()); prefEdit.putBoolean(key, ((Boolean) v).booleanValue());
else if (v instanceof Float) else if (v instanceof Float)
@ -255,6 +257,12 @@ public class ZipHelper {
prefEdit.putLong(key, ((Long) v).longValue()); prefEdit.putLong(key, ((Long) v).longValue());
else if (v instanceof String) else if (v instanceof String)
prefEdit.putString(key, ((String) v)); prefEdit.putString(key, ((String) v));
else if (v instanceof HashSet) {
try {
prefEdit.putStringSet(key, (HashSet<String>) v);
} catch (Exception ignored) {
}
}
} }
prefEdit.commit(); prefEdit.commit();