xenolightning / AudioSwitcher_v1

Version 1 of Audio Switcher
Microsoft Public License
894 stars 90 forks source link

Avoid unnecessary config file writing on window close #2139

Closed vlakoff closed 7 years ago

vlakoff commented 7 years ago

I have the "Close to Tray" setting checked, and I noticed the config file is written every time I close to tray the program window. (disclaimer: I have a SSD disk and a bit of OCPD)

So, I traced the culprit back to the line here. It was added in https://github.com/xenolightning/AudioSwitcher_v1/commit/dc73f0cfec11540d537c7f413dac7b5429479efd. It seems to be unnecessary because the config file is already written when a hotkey is added or deleted (see HotKeyManager and the "magic" setters in e.g. JsonSettings). Note that at the time the line was added, the configuration wasn't yet using the new system.