unification of the settings

Tomaz Canabrava tcanabrava at kde.org
Wed Aug 10 14:21:27 PDT 2016


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.

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.

Currently, on Subsurface:
almost all the user - preferences are on prefs.h in the preferences struct.
some user - preferences are set on random files via QSettings
non-user preferences are set on random files via QSettings (such as window
size, window state, last opened files)
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).
The Settings Dialog.

What I managed to do today:
- The settings dialog now uses my SettingsObjectWrapper
- 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
- Another few random uses where moved to the preferences +
SettingsObjectWrapper

What I want you guys to follow (not written in stone) on new patches that
may touch or insert a new settings:

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).

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).

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...)

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.

Regards,
Tomaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160810/ef166419/attachment-0001.html>


More information about the subsurface mailing list