<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>dirk asked me to finish the settings work that I had started a few months ago, this is an e-mail explaining what I'm doing.<br><br></div>A few days ago I got the current subsurface code to read it, as it has a long time since I don't actually program here (or at all) - I'm having a bit of trouble focusing currently so I'm slower than usual, but today I managed to do quite a few things.<br><br></div>Currently, on Subsurface:<br></div>almost all the user - preferences are on prefs.h in the preferences struct.<br></div>some user - preferences are set on random files via QSettings<br></div>non-user preferences are set on random files via QSettings (such as window size, window state, last opened files)<br></div>my monster SettingsObjectWrapper that holded all of the prefs in the preferences struct + Q_PROPERTY + signal + slot for each item (yes, I also hate the size of this, maybe I can create a thing to auto-generate this, but later).<br></div>The Settings Dialog.<br><br></div>What I managed to do today:<br></div>- The settings dialog now uses my SettingsObjectWrapper<br></div>- Default Dive Computer Settings stuff that was randomly declared on a few files is now in the prefs.h structure and also on my monster SettingsObjectWrapper <br></div>- Another few random uses where moved to the preferences + SettingsObjectWrapper<br><br></div>What I want you guys to follow (not written in stone) on new patches that may touch or insert a new settings:<br><br></div>If it's a settings that the user has no real control over (like the size of the window, size of the column in one of the lists, documents opened), use QSettings directly, save and restore the settings using QSettings and be happy (just check that there's not a key with the same name, or use a different group for it).<br><br></div>If it's a settings that the user has control, add it on the preferences struct, create the boilerplate code on SettingsObjectWrapper (or poke me for it).<br><br></div>This way we can actually know what are the string preferences that can affect the outcome of the application from the not so important ones, and it also makes hard to mispell something (the number of bugs that we got from mispelled QSetting keys and groups...)<br><br></div>I have around 12 patches ready to send here, but I really wanna test this very good before sending, so I'm sure I'll not break or annoy too many of you.<br><br></div>Regards,<br></div>Tomaz<br><div><div><div><div><div><div><br></div></div></div></div></div></div></div>