GNOME Bugzilla – Bug 616362
Port Empathy to GSettings
Last modified: 2011-08-29 10:12:37 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.
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
Would be good if we could avoid the hard dep, at least for now.
This is a WIP, currently crashes within GSettings: http://git.collabora.co.uk/?p=user/danni/empathy.git;a=shortlog;h=refs/heads/gsettings
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().
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.
(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.
Merged!