Re: path="" (or not) in GSettings schemas
- From: Alberto Ruiz <aruiz gnome org>
- To: Ryan Lortie <desrt desrt ca>
- Cc: gtk-devel-list gnome org
- Subject: Re: path="" (or not) in GSettings schemas
- Date: Fri, 19 Oct 2012 00:18:18 +0100
On the more extremist side of my point of view:
https://lkml.org/lkml/2012/3/8/495 }:-)
From a more reasonable standpoint, expecting app developers to keep up with every single library's changes is bad, specially for something so fundamental as GLib/GIO. I do think it's unfortunate, but I think that "fixing" this by breaking compatibility is creating a whole new problem.
I'd go for adding path="id" and making a better job at documenting this.
I do like the idea of adding relocatable="yes", we could add an informative warning to get people to start using it if just "id" is provided, that should help to migrate in the future, but I won't change it as long as GSettings is on a stable series.
Another idea would be to care less about the usability of the XML format and create an embeddable GUI to create schemas that people could use standalone or integrated with Anjuta/Monodevelop/FooBarIDE, having humans writting XMLs is a bad idea anyhow.
2012/10/17 Ryan Lortie
<desrt desrt ca>
hi,
One of the big design mistakes I made with GSettings is that this is really weird:
<schema id="org.a11y.atspi" path="/org/a11y/atspi/">
The requirement to specify a separate path is confusing. It causes people to think that maybe the path should have a prefix like /apps/. If you manage to avoid this trap and do it properly then it is completely redundant.
Of course, it is possible to omit the path to create a relocatable schema.
<schema id="org.a11y.atspi">
That's the crux of the mistake.
Relocatable schemas are somewhat rare in their use. The non-relocatable case is the 'ordinary one'. Ideally, the syntax (immediately) above should have been reserved to that common case.
Changing this now is a no-go, of course. There are existing applications that use the above syntax to define relocatable schemas.
I propose that we could bail ourselves out of this mess with a two-step process, as follows:
1) Start looking for a relocatable='' attribute on <schema>. If a
schema has no path and has not been marked as relocatable='yes' then
emit a warning (similar to what we do for path='/apps/*' already).
2) After a year or so, assume that schemas without relocatable='yes'
and with no path='' are schemas that wish to have a path
automatically assigned using the expected '.' to '/' mapping.
In this way we turn:
<schema id='a.b.c' path='/a/b/c/'> <!-- common case -->
<schema id='x.y.z'> <!-- uncommon case -->
to:
<schema id='a.b.c'> <!-- common case -->
<schema id='x.y.z' relocatable='yes'> <!-- uncommon case -->
Even if we don't do #2, I think doing #1 might be useful. I don't have any evidence (even anecdotal) to support the idea that the current situation is confusing but it seems that a helpful warning explaining to the user that "<schema id='a.b.c'>" doesn't mean what they think may be useful...
Thoughts?
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
--
Cheers,
Alberto Ruiz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]