Re: GSettings and profiles implementation

On Fri, 2011-01-28 at 09:43 -0500, Matthias Clasen wrote:
> On Fri, Jan 28, 2011 at 8:44 AM, Matthew Barnes <mbarnes redhat com> wrote:
> >
> >
> > This is not a knock against GSettings, it just took me awhile to realize
> > I was trying to fit a square peg in a round hole.  Evolution will still
> > use GSettings for general preferences, just not account information.
> >
> gsettingslist was supposed to handle exactly this kind of use case:
> storing lists of e.g. account data. Unforunately, the gsettingslist
> implementation has been slow in coming (if it comes at all)

I just want to point out that you can, right now, store any
number of sets of the same kind of settings. GSettings lets
you define a schema without making a hard association to a
path, and you can create a path at run-time using a schema.

Yelp does this already. It stores most things per-document.
It creates a path for each document, applying the same schema
to each of them. For anybody looking for sample code, Yelp is
a fairly simple non-trivial use of GSettings.

What GSettingsList allows you to do, if I understand correctly,
is retrieve a list of those paths you created. Yelp doesn't
need to do this, but I see where Evolution would. (Getting all
accounts is just getting all paths that conform to some schema
like org.gnome.evolution.account.)

And it seems to me this isn't an insurmountable problem. You
should just be able to define a key in your top-level schema
to list the accounts. It's a bit more work, remembering to
set and reset it in various places, but not impossible.

GSettingsList seems like a very-nice-to-have convenience API
to me, but certainly not a blocker for functionality.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]