On Sat, 2014-04-12 at 14:02 +0200, Gehad wrote: > On 04/11/2014 04:19 PM, Dirk Hohndel wrote: > > > > I think I had something slightly different in mind: > > > > The prefs variable should contain a member for each setting. And we need
That was too simplistic :-) > > to redo those members so they are actually identical to the name of the > > setting (it's ridiculous that we have these tiny variations between the > > string used as key in QSettings and the member of the struct > > preferences). > > > > Whenever the code needs to check a preference, just use > > > > if (prefs.whatever == ...) That's really the criteria I am looking for. The things we check in such a way are the things that should be in the prefs structure. Others make no sense - I'm thinking # "ListWidget" ## - "colwidth0" - "colwidth1" - "colwidth13" - "colwidth2" - "colwidth3" - "colwidth4" those make no sense in prefs - same goes for all the other colwidth values. But the TecDetails, Units, all the settings that we need to look at in several places should be in prefs. > I Made a list of all Qsettings in subsurface there is 18 settings Group > and 92 keys, we have to make prefs members for all the 92 keys (some of > them is used while initialization only) ? > > Also I think if we didn't add all the settings to the prefs structure > using that macro can be dangerous. > > I attached the list of all Keys. Thanks for doing this - that really helped clarify what I wanted and made it much easier to talk about this. Great work. /D _______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
