Closed jnooree closed 3 years ago
About the calculator: it's intentional. The code is in place, just the button is disabled. The reason is that it's completely weird and impossible to do calculations, because for problem to be correctly defined, a user should have the ability to choose what's the input data and what's the result field. Otherwise it's impossible to type the input data because the values are constantly recomputed when I still haven't finished entering the input data. I'm planning to improve it by adding radio buttons near the input fields and enable the calculator in one of the following updates.
About the delay: the cause of the delay is icon deduplication. It compares the icon files byte-by-byte. 1) The resolution and icon plists should be parsed where they are currently parsed, because otherwise RDM wouldn't reload them if they are modified by hand, by another instance of RDM or by SwitchResX. 2) The main functionality of the app is resolution switching, not editing, so it's not a good idea to load plists and icons if they are unlikely to be used and introduce a startup delay. 3) Caching can be an improvement – the icons can be loaded when the edit window is opened for the first time. But, again, it doesn't seem very useful as usually this window is opened only once until reboot. 4) Using a hash of file can improve the performance, as byte-by-byte comparison would only be done for equal files. Maybe some day I'll do that.
Thank you for the detailed explanations.
First, the calculator (which I have added) was removed in release
2.5.0
. Was it intentional or accidental? If it was intentional, please explain the reason why, and maybe suggest improvements for it. Second, the app is currently parsing all the information when the view controller is about to be appear, but I think this adds significant delay before the editor window appears. Maybe moving this code to the initialization step of the app will improve performance. https://github.com/usr-sse2/RDM/blob/d8ecf99074d369e15f949e7fcf49695e2df85cbc/src/ViewController.swift#L125-L212