From fa4a42d741fade66d51857fb2653e27e347aef80 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 1 Nov 2011 17:26:07 +0100 Subject: Migrate SA extension to GSettings --- modules/spamassassin/evolution-spamassassin.c | 38 +++++++++------------------ 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'modules/spamassassin') diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c index b578acf228..a628753aba 100644 --- a/modules/spamassassin/evolution-spamassassin.c +++ b/modules/spamassassin/evolution-spamassassin.c @@ -25,7 +25,6 @@ #include #include -#include #include /* Standard GObject macros */ @@ -1074,7 +1073,7 @@ e_spam_assassin_class_init (ESpamAssassinClass *class) junk_filter_class->available = spam_assassin_available; junk_filter_class->new_config_widget = spam_assassin_new_config_widget; - /* XXX Argh, the boolean sense of the GConf key is inverted from + /* XXX Argh, the boolean sense of the GSettings key is inverted from * that of the checkbox widget. The checkbox wording is more * natural, but GConfBridge doesn't support transform functions * so the property has to match the sense of the GConf key. */ @@ -1146,36 +1145,23 @@ e_spam_assassin_interface_init (CamelJunkFilterInterface *interface) static void e_spam_assassin_init (ESpamAssassin *extension) { + GSettings *settings; + extension->socket_path_mutex = g_mutex_new (); /* XXX Once we move to GSettings these probably don't * need to be properties anymore. GConfBridge is * just easier to deal with than GConfClient. */ - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/local_only", - G_OBJECT (extension), "local-only"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/spamc_binary", - G_OBJECT (extension), "spamc-binary"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/spamd_binary", - G_OBJECT (extension), "spamd-binary"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/socket_path", - G_OBJECT (extension), "socket-path"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/use_daemon", - G_OBJECT (extension), "use-daemon"); + settings = g_settings_new ("org.gnome.evolution.mail"); + + g_settings_bind (settings, "junk-sa-local-only", G_OBJECT (extension), "local-only", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-spamc-binary", G_OBJECT (extension), "spamc-binary", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-spamd-binary", G_OBJECT (extension), "spamd-binary", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-socjet-path", G_OBJECT (extension), "socket-path", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-use-daemon", G_OBJECT (extension), "use-daemon", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); if (extension->spamc_binary == NULL) extension->spamc_binary = g_strdup (SPAMC_BINARY); -- cgit v1.2.3