GNOME Bugzilla – Bug 646402
[patch] port devhelp to gsettings
Last modified: 2012-12-19 10:15:05 UTC
This series of patches removes the dependency on GConf. Because gsettings is part of glib properly, I think that replacing the IGE configuration interface should be acceptable. If glib is available on OS X, then GIO should be there, and thus gsettings. This may be a bit controvertial, so, if you think that it may be better to retain the IGE usage, let me know, and I can try to add a GSettings IGE implementation.
Created attachment 184846 [details] [review] patches/0006-devhelp-add-gsettings-schema.patch [1/3] add gsettings schema
Created attachment 184847 [details] [review] patches/0007-devhelp-port-to-gsettings.patch [2/3] make devhelp go to gsettings rather than GConf.
Created attachment 184848 [details] [review] patches/0008-devhelp-remove-gconf-support.patch [3/3] remove GConf bits all together.
+ <key name="height" type="i"> + <default>400</default> + <summary>assistant window height</summary> + <description>The height of the assistant window</description> + </key> + <key name="width" type="i"> + <default>350</default> + <summary>assistant window width</summary> + <description>The width of the assistant window</description> + </key> + <key name="x-position" type="i"> + <default>0</default> + <summary>assistant window's x-position</summary> + <description>The x-position of the assistant window</description> + </key> + <key name="y-position" type="i"> + <default>0</default> + <summary>assistant window's y-position</summary> + <description> The y-position of the assistant window</description> + </key> These should all have a <range min="...">. Same for the other window size/position settings. And it would be nicer if there was a common schema which contained the others as children, and you'd then use g_settings_get_child(). <schema id="org.gnome.devhelp" path="/org/gnome/devhelp/"> <child name="books" schema="org.gnome.devhelp.books" /> .... </schema> For the window position/size/state settings, you should really construct a delayed setting, and only apply it when exiting (or if you prefer, after a timeout), since otherwise you'll hammer dbus and dconf when resizing / moving windows.
Awesome, the child schema thing is similar to what I wanted. Ill modify the patches to that form. As far as the delayed setting ... is that a property of the GSettings or should I be implementing my own stabality check timeout and then performing the setting once that is triggered?
See g_settings_delay() and g_settings_apply(). If you think that saving on exit is enough, just do apply() on exit (and g_settings_sync()); or do the apply() in a timeout after size/pos changes.
*** Bug 577013 has been marked as a duplicate of this bug. ***
Also take a look to http://git.gnome.org/browse/devhelp/log/?h=gsettings
That branch is obsolete and doesn't work :/ Saleem, sorry I forgot about this bug, would you have a new patch ready?
Saleem: Do you still plan to work on this and update the branch?
Created attachment 210534 [details] [review] stop using obsoleted default keys I'm a bit curious about the (...) progress of this bug. With devhelp 3.2.0, following patch was kind of working - it's not a complete port, it just stops devhelp from reading /desktop/gnome/interface/{,monospace_}font_name keys - I don't really use Gnome, but does a standard Gnome installation provides/uses those keys anymore ? Both of these were provided by libgnome, so unless Gnome config tools still touch them, they're most likely either empty or contain outdated values. This would add a runtime dep on gsettings-desktop-schemas, but just about everything in Gnome in some way depends on it already.
Created attachment 213344 [details] [review] stop using obsoleted default keys (updated for 3.4.1) (In reply to comment #11) > Created an attachment (id=210534) [details] [review] > stop using obsoleted default keys The patch from comment #11 does not cleanly apply to devhelp-3.4.1. I am attaching a trivial update of it that does so.
Comment on attachment 213344 [details] [review] stop using obsoleted default keys (updated for 3.4.1) Thanks; I pushed that one, but this bug report is still valid, devhelp own gconf keys should be ported to gsettings.
I migrated devhelp to gsettings in the branch "gsettings-migration" (see http://git.gnome.org/browse/devhelp/log/?h=gsettings-migration). Can some please review the branch?
Thanks Thomas; I only had a quick look but it looks fine; Alexandre would you have time to give it a try?
Hi Thomas, only a little comment: Since intltool 0.50.1, schema files are supported, so all you have to do is to add your .gschema.xml files to POTFILES.in with a line like: [type: gettext/gsettings]data/org.foo.MyApp.gschema.xml So no need for a *.gschema.xml.in file at all. See the docs for more detailed info: http://developer.gnome.org/gio/2.34/ch31s06.html
(In reply to comment #16) > Hi Thomas, > > only a little comment: Since intltool 0.50.1, schema files are supported, so > all you have to do is to add your .gschema.xml files to POTFILES.in with a line > like: > > [type: gettext/gsettings]data/org.foo.MyApp.gschema.xml Done. I updated the branch.
Hi Thomas, I think you can remove these lines now: @INTLTOOL_SCHEMAS_RULE@ @INTLTOOL_XML_NOMERGE_RULE@ Thanks for working on this!
(In reply to comment #18) > I think you can remove these lines now: > > @INTLTOOL_SCHEMAS_RULE@ > @INTLTOOL_XML_NOMERGE_RULE@ Done. Thanks for the help!
(In reply to comment #15) > Thanks Thomas; I only had a quick look but it looks fine; Alexandre would you > have time to give it a try? The current head of the gsettings-migration branch works fine here, but to be honest, I am not familiar enough with devhelp's codebase to give it a proper code review.
I have now merged the branch; thanks a lot.