mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Merge pull request #100 from sgk/sortPrefs
Sort keys in the preferences.txt.
This commit is contained in:
commit
92d1c8eac3
@ -734,11 +734,10 @@ public class Preferences {
|
|||||||
// Fix for 0163 to properly use Unicode when writing preferences.txt
|
// Fix for 0163 to properly use Unicode when writing preferences.txt
|
||||||
PrintWriter writer = PApplet.createWriter(preferencesFile);
|
PrintWriter writer = PApplet.createWriter(preferencesFile);
|
||||||
|
|
||||||
Enumeration e = table.keys(); //properties.propertyNames();
|
String[] keys = (String[])table.keySet().toArray(new String[0]);
|
||||||
while (e.hasMoreElements()) {
|
Arrays.sort(keys);
|
||||||
String key = (String) e.nextElement();
|
for (String key: keys)
|
||||||
writer.println(key + "=" + ((String) table.get(key)));
|
writer.println(key + "=" + ((String) table.get(key)));
|
||||||
}
|
|
||||||
|
|
||||||
writer.flush();
|
writer.flush();
|
||||||
writer.close();
|
writer.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user