Store user preferences to a XML file just in case system preferences subsystem (e.g. Windows Registry) has issues

This commit is contained in:
Reinhard Pointner 2018-03-17 20:40:31 +07:00
parent c67ea9e73d
commit 3323ae1aa7
1 changed files with 4 additions and 1 deletions

View File

@ -73,6 +73,9 @@ public class Main {
if (args.clearUserData()) { if (args.clearUserData()) {
log.info("Reset preferences"); log.info("Reset preferences");
Settings.forPackage(Main.class).clear(); Settings.forPackage(Main.class).clear();
// restore preferences on start if empty (TODO: remove after a few releases)
ApplicationFolder.AppData.resolve("preferences.backup.xml").delete();
} }
// clear caches // clear caches
@ -210,7 +213,7 @@ public class Main {
HistorySpooler.getInstance().commit(); HistorySpooler.getInstance().commit();
SupportDialog.maybeShow(); SupportDialog.maybeShow();
// backup preferences on exit // restore preferences on start if empty (TODO: remove after a few releases)
Settings.store(ApplicationFolder.AppData.resolve("preferences.backup.xml")); Settings.store(ApplicationFolder.AppData.resolve("preferences.backup.xml"));
System.exit(0); System.exit(0);