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 616362 - Port Empathy to GSettings
Port Empathy to GSettings
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
2.30.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks: 621338
 
 
Reported: 2010-04-21 05:04 UTC by Danielle Madeley
Modified: 2011-08-29 10:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
port to gsettings (184.80 KB, patch)
2010-06-11 06:45 UTC, Danielle Madeley
reviewed Details | Review

Description Danielle Madeley 2010-04-21 05:04:20 UTC
We should port Empathy to GSettings, and drop as much of our dependency on GConf as possible (I expect in the short-term we'll still require GConf for accessing desktop-wide preferences as well as for the GConf GSettings-backend).

This looks reasonably trivial to do (most of our configuration is already abstracted by EmpathyConf), but will bump our dependencies up to GLib 2.25.1 and GConf 2.31.1 (for the GConf GSettings backend). So doing this would make it harder to support Empathy in the PPA.

We could conceivably #define accesses in EmpathyConf for the time being, so that we didn't need to bump our minimum versions.
Comment 1 Danielle Madeley 2010-04-21 05:12:50 UTC
Resources:

 * Migration Guide: http://library.gnome.org/devel/gio/2.25/ch23.html
 * API reference: http://library.gnome.org/devel/gio/2.25/settings.html
 * Tools reference: http://library.gnome.org/devel/gio/2.25/tools.html
 * Tutorial: http://git.gnome.org/browse/gnome-utils/log/?h=gsettings-tutorial

Usages of GConf inside Empathy:

 * empathy-conf: needs migrating
 * empathy-import-mc4-accounts: mostly concerned with migration from MC4 to MC5, reading MC4 info could probably be left as GConf; sets one Empathy key, this should be changed to using EmpathyConf
 * empathy-theme-adium: requests the desktop-wide font name, requires separate porting
 * cc-empathy-accounts-panel: calls gconf_client_add_dir() - could be replaced by initialising EmpathyConf
Comment 2 Guillaume Desmottes 2010-04-21 07:16:26 UTC
Would be good if we could avoid the hard dep, at least for now.
Comment 3 Danielle Madeley 2010-06-10 09:54:27 UTC
This is a WIP, currently crashes within GSettings: http://git.collabora.co.uk/?p=user/danni/empathy.git;a=shortlog;h=refs/heads/gsettings
Comment 4 Danielle Madeley 2010-06-11 06:45:46 UTC
Created attachment 163362 [details] [review]
port to gsettings

Ok, this is looking in pretty good now.

EmpathyConf is gone, the schemas have been migrated to a GSettings schema. This is a direct port, replacing get, set and notifications directly to the equivalent in GSettings.

The only part of the code that takes advantage of GSetting binding is the preferences dialog (the preferences dialog had a hand cooked version of something like this). More of the code could be ported to g_settings_bind().
Comment 5 Guillaume Desmottes 2010-06-11 10:24:29 UTC
Review of attachment 163362 [details] [review]:

Looks pretty good to me, good work! I inlined some comments.

Please open another bug explaining remaining things we should do to make better use of the gsettings API.

::: libempathy-gtk/empathy-chat-text-view.c
@@ +212,3 @@
+	font_name = gconf_client_get_string (priv->gconf_client,
+			"/desktop/gnome/interface/document_font_name",
+			NULL);

Add a FIXME and open an empathy depending on the GNOME bug tracking the migration of this key to dconf.

::: data/org.gnome.Empathy.gschema.xml.in
@@ +1,1 @@
+<schemalist>

I assume this one is fine. Did you generate it using a migration tool or something.

::: src/empathy-import-mc4-accounts.c
@@ +34,3 @@
 #include <libempathy/empathy-account-settings.h>
 #include <libempathy/empathy-connection-managers.h>
+#include <libempathy/empathy-gsettings.h>

Tbh I think we can remove this file now.
Comment 6 Danielle Madeley 2010-06-12 01:21:12 UTC
(In reply to comment #5)
> Review of attachment 163362 [details] [review]:
> 
> Looks pretty good to me, good work! I inlined some comments.
> 
> Please open another bug explaining remaining things we should do to make better
> use of the gsettings API.

Bug #621338.

> ::: libempathy-gtk/empathy-chat-text-view.c
> @@ +212,3 @@
> +    font_name = gconf_client_get_string (priv->gconf_client,
> +            "/desktop/gnome/interface/document_font_name",
> +            NULL);
> 
> Add a FIXME and open an empathy depending on the GNOME bug tracking the
> migration of this key to dconf.

Do we know what bug number this is?

> ::: data/org.gnome.Empathy.gschema.xml.in
> @@ +1,1 @@
> +<schemalist>
> 
> I assume this one is fine. Did you generate it using a migration tool or
> something.

Yeah, I used the provided migration tool.

> ::: src/empathy-import-mc4-accounts.c
> @@ +34,3 @@
>  #include <libempathy/empathy-account-settings.h>
>  #include <libempathy/empathy-connection-managers.h>
> +#include <libempathy/empathy-gsettings.h>
> 
> Tbh I think we can remove this file now.

You mean import-mc4-accounts ? Seems worth leaving in for the people who skip versions of GNOME.
Comment 7 Danielle Madeley 2010-06-18 02:02:03 UTC
Merged!