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 646402 - [patch] port devhelp to gsettings
[patch] port devhelp to gsettings
Status: RESOLVED FIXED
Product: devhelp
Classification: Applications
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: devhelp-maint
devhelp-maint
: 577013 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-04-01 02:28 UTC by Saleem Abdulrasool
Modified: 2012-12-19 10:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patches/0006-devhelp-add-gsettings-schema.patch (6.37 KB, patch)
2011-04-01 02:29 UTC, Saleem Abdulrasool
none Details | Review
patches/0007-devhelp-port-to-gsettings.patch (24.40 KB, patch)
2011-04-01 02:29 UTC, Saleem Abdulrasool
none Details | Review
patches/0008-devhelp-remove-gconf-support.patch (47.25 KB, patch)
2011-04-01 02:30 UTC, Saleem Abdulrasool
none Details | Review
stop using obsoleted default keys (3.16 KB, patch)
2012-03-24 22:04 UTC, Rafał Mużyło
none Details | Review
stop using obsoleted default keys (updated for 3.4.1) (3.62 KB, patch)
2012-05-03 05:12 UTC, Alexandre Rostovtsev
committed Details | Review

Description Saleem Abdulrasool 2011-04-01 02:28:42 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.
Comment 1 Saleem Abdulrasool 2011-04-01 02:29:17 UTC
Created attachment 184846 [details] [review]
patches/0006-devhelp-add-gsettings-schema.patch

[1/3] add gsettings schema
Comment 2 Saleem Abdulrasool 2011-04-01 02:29:50 UTC
Created attachment 184847 [details] [review]
patches/0007-devhelp-port-to-gsettings.patch

[2/3] make devhelp go to gsettings rather than GConf.
Comment 3 Saleem Abdulrasool 2011-04-01 02:30:25 UTC
Created attachment 184848 [details] [review]
patches/0008-devhelp-remove-gconf-support.patch

[3/3] remove GConf bits all together.
Comment 4 Christian Persch 2011-04-01 13:17:33 UTC
+        <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.
Comment 5 Saleem Abdulrasool 2011-04-01 14:32:31 UTC
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?
Comment 6 Christian Persch 2011-04-01 14:39:58 UTC
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.
Comment 7 Javier Jardón (IRC: jjardon) 2011-06-08 11:26:59 UTC
*** Bug 577013 has been marked as a duplicate of this bug. ***
Comment 8 Javier Jardón (IRC: jjardon) 2011-06-08 11:40:32 UTC
Also take a look to http://git.gnome.org/browse/devhelp/log/?h=gsettings
Comment 9 Frederic Peters 2011-06-08 12:23:24 UTC
That branch is obsolete and doesn't work :/  Saleem, sorry I forgot about this bug, would you have a new patch ready?
Comment 10 André Klapper 2011-09-13 13:22:57 UTC
Saleem: Do you still plan to work on this and update the branch?
Comment 11 Rafał Mużyło 2012-03-24 22:04:58 UTC
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.
Comment 12 Alexandre Rostovtsev 2012-05-03 05:12:34 UTC
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 13 Frederic Peters 2012-05-03 10:01:10 UTC
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.
Comment 14 Thomas Bechtold 2012-12-02 16:54:09 UTC
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?
Comment 15 Frederic Peters 2012-12-03 13:37:23 UTC
Thanks Thomas; I only had a quick look but it looks fine; Alexandre would you have time to give it a try?
Comment 16 Javier Jardón (IRC: jjardon) 2012-12-03 17:57:21 UTC
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
Comment 17 Thomas Bechtold 2012-12-03 20:47:23 UTC
(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.
Comment 18 Javier Jardón (IRC: jjardon) 2012-12-04 03:59:26 UTC
Hi Thomas,

I think you can remove these lines now:

@INTLTOOL_SCHEMAS_RULE@
@INTLTOOL_XML_NOMERGE_RULE@

Thanks for working on this!
Comment 19 Thomas Bechtold 2012-12-04 07:10:15 UTC
(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!
Comment 20 Alexandre Rostovtsev 2012-12-06 08:36:53 UTC
(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.
Comment 21 Frederic Peters 2012-12-19 10:15:05 UTC
I have now merged the branch; thanks a lot.