Don't save a new preferences file in Preferences.init

Preferences.init would write out the default preferences when no
preference file previously existed. This would cause a default
preferences file to be written even when --no-save-prefs was passed, due
to the ordering of things.

However, since the Base constructor now already calls
Preferences.save(), there is no need for Preferences.init to also do
this. Since Base calls this after parsing the commandline, the
--no-save-prefs option is now also properly respected.
This commit is contained in:
Matthijs Kooijman 2014-04-07 11:30:00 +02:00 committed by Cristian Maglie
parent 4452eb3850
commit d6333f8f37
1 changed files with 1 additions and 5 deletions

View File

@ -266,11 +266,7 @@ public class Preferences {
} }
} }
if (!preferencesFile.exists()) { if (preferencesFile.exists()) {
// create a new preferences file if none exists
// saves the defaults out to the file
save();
} else {
// load the previous preferences file // load the previous preferences file
try { try {
load(new FileInputStream(preferencesFile)); load(new FileInputStream(preferencesFile));