[PATCH 3/3] Clean up preference saving code

Dirk Hohndel dirk at hohndel.org
Fri Jan 11 06:10:44 PST 2013


Henrik Brautaset Aronsen <henrik at synth.no> writes:

> Linus Torvalds wrote:
>> The old code (on purpose) didn't try to differentiate "nonexisting
>> boolean configuration" with "existing boolean configuration set to
>> false", which is problematic if we optimize the saving to not save
>> default preferences at all.
>
> If I start Subsurface without any config file, enter and exit the 
> Preferences, and exit, some default settings will still be saved:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
>          <key>divelist_font</key>
>          <string>Arial Unicode MS 9</string>
>          <key>gfhigh</key>
>          <string>75</string>
>          <key>gflow</key>
>          <string>30</string>
>          <key>phethreshold</key>
>          <string>13.0</string>
>          <key>pn2threshold</key>
>          <string>4.0</string>
>          <key>po2threshold</key>
>          <string>1.6</string>
> </dict>
> </plist>

Those are the non-BOOL preferences. I think Linus mentioned in his email
that he only did the "don't save defaults" for boolean values so far. My
guess is that another patch that addresses these is in the works
already.

/D


More information about the subsurface mailing list