[PATCH] Unexpected Behaviour in preference window.
Lubomir I. Ivanov
neolit123 at gmail.com
Fri Apr 11 02:31:29 PDT 2014
On 11 April 2014 11:44, Gehad Elrobey <gehadelrobey at gmail.com> wrote:
> On Thu, Apr 10, 2014 at 7:19 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>> On Tue, 2014-04-08 at 14:11 +0200, Gehad wrote:
>> > On 04/07/2014 10:22 PM, Dirk Hohndel wrote:
>> > > I'd really like to have a prefs variable that tracks the currently
>> > > active prefs and only reference that anywhere in the code. The only
>> > > place that should mess with s.value should be preferences.cpp
>> > And when will the prefs be synchronized with the QSettings ?
>> > I found that some QSettings are changed in the middle of the code not
>> > only from preference window or at startup.
>> instead of the writing of QSettings all over the place I'd rather do
>> this only in one space and have accessor functions that do the right
>> thing. Maybe I'm overthinking this, but whenever I try to figure out
>> something that's going wrong with preferences my eyes glaze over...
> There are some functions in pref.h that I couldn't find their implementation
> I think they are not implemented, Right ?
> extern void subsurface_open_conf(void);
> extern void subsurface_set_conf(const char *name, const char *value);
> extern void subsurface_set_conf_bool(const char *name, bool value);
> extern void subsurface_set_conf_int(const char *name, int value);
> extern void subsurface_unset_conf(const char *name);
> extern const char *subsurface_get_conf(const char *name);
> extern int subsurface_get_conf_bool(const char *name);
> extern int subsurface_get_conf_int(const char *name);
> extern void subsurface_flush_conf(void);
> extern void subsurface_close_conf(void);
> Are those the accessor functions you were talking about ? also there is some
> macros defined in preferences.cpp they do a similar job to these functions,
> this is confusing me a little bit.
> I can work on this, But I don't understand how the whole thing is supposed
> to work.
the above list of functions are leftovers from the GTK version where
we wrote ourselves OS native code to handle the settings writing.
now we can use Qt for that, but the functions still make sense, in a way.
what Dirk describes, i believe, is a local class or a set of global
C++ functions that will wrap the QSettings integration in Subsurface.
this would be nice, because we can have better control over things and
don't need to use the QSettings class directly inside the code.
More information about the subsurface