GNOME Bugzilla – Bug 668234
Use GSettings API to decode schemas
Last modified: 2015-10-14 01:56:39 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.
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)
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.
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.
@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)
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.
[moving dconf>editor tickets to dconf-editor product. See bug 744791]
*** Bug 745947 has been marked as a duplicate of this bug. ***
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?
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
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.