Hello,
Not sure the official channel on how to suggest these changes, so I thought I would add it here.
I noticed that on Android the ini files are written kind of randomly. The section headers are in reverse order, especially the WiimodeNew.ini, and the entries in the section are random.
I found the code that writes this:
In the Android\app\src\main\java\org\dolphinemu\dolphinemu\utils\SettingsFile.java file, under the saveFile function:
I found adding in a TreeSet and looping on it instead sorts the section headers:
Also in the same file, the writeSection, the existing code just adds them to the file in the order they are in:
Adding in the same Treeset and itterating over it sorts all the entries in the list:
It was a matter of adding in 2 lines and editing 2 for loops to use it.
This really helps in terms of looking for options in a file.
If there is an official way to request a feature like this with code example, please let me know.
Thanks,
Nathan
Not sure the official channel on how to suggest these changes, so I thought I would add it here.
I noticed that on Android the ini files are written kind of randomly. The section headers are in reverse order, especially the WiimodeNew.ini, and the entries in the section are random.
I found the code that writes this:
In the Android\app\src\main\java\org\dolphinemu\dolphinemu\utils\SettingsFile.java file, under the saveFile function:
Code:
Set<String> keySet = sections.keySet();
for (String key : keySet)
{
SettingSection section = sections.get(key);
writeSection(writer, section);
}
I found adding in a TreeSet and looping on it instead sorts the section headers:
Code:
Set<String> keySet = sections.keySet();
[b]Set<String> sortedKeySet = new TreeSet<>(keySet);[/b]
[b]for (String key : sortedKeySet)[/b]
{
SettingSection section = sections.get(key);
writeSection(writer, section);
}
Also in the same file, the writeSection, the existing code just adds them to the file in the order they are in:
Code:
HashMap<String, Setting> settings = section.getSettings();
Set<String> keySet = settings.keySet();
for (String key : keySet)
{
Setting setting = settings.get(key);
String settingString = settingAsString(setting);
writer.println(settingString);
}
Adding in the same Treeset and itterating over it sorts all the entries in the list:
Code:
HashMap<String, Setting> settings = section.getSettings();
Set<String> keySet = settings.keySet();
[b]Set<String> sortedKeySet = new TreeSet<>(keySet);[/b]
[b]for (String key : sortedKeySet)[/b]
{
Setting setting = settings.get(key);
String settingString = settingAsString(setting);
writer.println(settingString);
}
It was a matter of adding in 2 lines and editing 2 for loops to use it.
This really helps in terms of looking for options in a file.
If there is an official way to request a feature like this with code example, please let me know.
Thanks,
Nathan