1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

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

View File

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