![]() |
|
Code suggestion for android ini files - Printable Version +- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org) +-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support) +--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion) +--- Thread: Code suggestion for android ini files (/Thread-code-suggestion-for-android-ini-files) |
Code suggestion for android ini files - nitro001 - 02-16-2017 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: Code: Set<String> keySet = sections.keySet();I found adding in a TreeSet and looping on it instead sorts the section headers: Code: Set<String> keySet = sections.keySet();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();Adding in the same Treeset and itterating over it sorts all the entries in the list: Code: HashMap<String, Setting> settings = section.getSettings();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 RE: Code suggestion for android ini files - JosJuice - 02-16-2017 If you have working code for it, feel free to submit it at https://github.com/dolphin-emu/dolphin/pulls. RE: Code suggestion for android ini files - nitro001 - 02-17-2017 (02-16-2017, 05:26 PM)JosJuice Wrote: If you have working code for it, feel free to submit it at https://github.com/dolphin-emu/dolphin/pulls. OK, I know I probably did a developer faux pas, but I pulled my project source from a clone the master instead of creating a fork, but I do know better than to just check into master. I wasn't sure of the process since most of my projects are with small groups and we base off of master. I can save off my changes, create and re-base from a fork. I didn't find any documentation on that part of the setup on getting started with the project. Please let me know if that is the correct procedure. Thanks, Nathan RE: Code suggestion for android ini files - JosJuice - 02-17-2017 Whether you've done your work in your local master branch doesn't matter to us, since it isn't our master branch (but maybe it would be annoying to you if you want to use your local master branch for something else while the pull request is open). If you want to, you can copy over your changes to a different branch before you create a pull request, but it's not required. Just keep in mind that once the pull request is created, you can't change which branch the pull request uses. If you haven't created a fork on GitHub yet, I think you'll need to do so. But it should be possible to push your existing changes to that fork repo instead of recreating them. I'm not sure if I completely understand what you have done and haven't done this far, so please tell me if anything is unclear. RE: Code suggestion for android ini files - nitro001 - 02-17-2017 (02-17-2017, 01:51 AM)JosJuice Wrote: Whether you've done your work in your local master branch doesn't matter to us, since it isn't our master branch (but maybe it would be annoying to you if you want to use your local master branch for something else while the pull request is open). If you want to, you can copy over your changes to a different branch before you create a pull request, but it's not required. Just keep in mind that once the pull request is created, you can't change which branch the pull request uses. Thank you for the help, I created a fork, re-based it, put in my change for the sort and created a pull request: Android: Sort configuration ini files #4918 RE: Code suggestion for android ini files - nitro001 - 02-17-2017 (02-17-2017, 02:50 AM)nitro001 Wrote: Thank you for the help, I created a fork, re-based it, put in my change for the sort and created a pull request:Corrected the re-case and consolidated commit files into new pull request: Android: Sort configuration ini files #4919 RE: Code suggestion for android ini files - Helios - 02-17-2017 Hey Nitro, it may be easier for you to communicate with us on IRC freenode - #dolphin-dev |