After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668234 - Use GSettings API to decode schemas
Use GSettings API to decode schemas
Status: RESOLVED FIXED
Product: dconf-editor
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: dconf-editor maintainer(s)
dconf-editor maintainer(s)
: 745947 (view as bug list)
Depends on: 646039 668232 668233
Blocks:
 
 
Reported: 2012-01-19 02:38 UTC by Robert Ancell
Modified: 2015-10-14 01:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Program showing what we can get currently with the API (3.10 KB, text/x-csrc)
2012-01-19 02:40 UTC, Robert Ancell
  Details
Use g_settings_get_default_value to get the default value (6.47 KB, patch)
2014-05-01 18:06 UTC, Mike Gorse
none Details | Review
Revised patch. (6.36 KB, patch)
2014-08-05 19:49 UTC, Mike Gorse
none Details | Review

Description Robert Ancell 2012-01-19 02:38:37 UTC
It would be nice to throw all the schema code away in dconf-editor and use the GSettings API to get all the schema information.
Comment 1 Robert Ancell 2012-01-19 02:40:19 UTC
Created attachment 205599 [details]
Program showing what we can get currently with the API

We still need the following from the API:
- Key summaries and descriptions (bug 668232)
- Default values and if this key is unset (i.e. the default) (bug 668233)
- No crashes when loading invalid schemas (bug 646039)
Comment 2 Robert Ancell 2012-01-19 03:01:40 UTC
Note by using the GSettings API we will no longer show dconf keys do not have a schema - this is probably not a bad thing though as most people don't want to see these.

Once switching to the GSettings API this is really "GSettings editor", not "dconf-editor" and should probably be split into a separate project.
Comment 3 Mike Gorse 2014-05-01 18:06:00 UTC
Created attachment 275563 [details] [review]
Use g_settings_get_default_value to get the default value

I noticed this bug while investigating a downstream bug showing that dconf-editor doesn't take dconf databases into account when showing the default value. Ie, it reports the default value from the schema, but clicking "Set to Default" sets the key to the value stored in the database, rather than the value displayed as the default value. I'll file a separate bug for that here if you wish, but I'm not sure if it is worth it since it makes sense to use the new GSettings API, and this patch fixes the bug for me.
Comment 4 Dominique Leuenberger 2014-08-05 18:19:21 UTC
@Mike

Starting dconf-editor with this patch applied results in a lot of warnings on terminal in the form of:

** (dconf-editor:5970): WARNING **: dconf-schema.vala:118: Unknown child tag in <key>, <default>

(
> dconf-editor 2>&1 | grep "dconf-schema.vala:118" | wc -l
2740
)

(as seen on openSUSE Factory / GNOME:Next with your patch applied)
Comment 5 Mike Gorse 2014-08-05 19:49:15 UTC
Created attachment 282603 [details] [review]
Revised patch.

Thanks. I guess we should at least check for a default value even if we don't use it.
Comment 6 André Klapper 2015-02-22 12:24:04 UTC
[moving dconf>editor tickets to dconf-editor product. See bug 744791]
Comment 7 Allison Karlitskaya (desrt) 2015-03-13 00:55:56 UTC
*** Bug 745947 has been marked as a duplicate of this bug. ***
Comment 8 Dominique Leuenberger 2015-09-16 06:46:53 UTC
opensuse has been adding this patch to the package for a while now, without any negative effects being noticed.

What's upstreams take on this patch?
Comment 9 Arnaud B. 2015-09-30 20:57:04 UTC
Mike’s bug and patch are definitively not related to this bugzilla entry. But aren’t they related to bug 753232[1] now? In any way, I’m not sure that using an API for querying only one information is the good way to go. But I’ll try to understand this problem.

I close the bug as Dconf Editor now uses the GSettingsSchema* APIs, instead of its own schema parser.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=753232
Comment 10 Arnaud B. 2015-10-14 01:56:39 UTC
Dconf Editor uses in its development “master” branch GSettings to access and edit keys when possible, so that should solve the #c3 problem. The correction will be available in the 3.20 release, in six months.