aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-10-26 18:29:31 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-10-26 18:29:31 +0800
commit8d001181fbaf1350764e75c28f61e1ae3498dbb3 (patch)
treea4a3899800c9e95aed4474698681b8127ed3180b /e-util
parent6b104de6536863409d853f1822075ff1393618c4 (diff)
downloadgsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.tar
gsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.tar.gz
gsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.tar.bz2
gsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.tar.lz
gsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.tar.xz
gsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.tar.zst
gsoc2013-evolution-8d001181fbaf1350764e75c28f61e1ae3498dbb3.zip
Almost no more GConf in e-util
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-plugin.c36
-rw-r--r--e-util/e-signature-list.c5
-rw-r--r--e-util/e-signature-list.h4
-rw-r--r--e-util/e-signature-utils.c7
-rw-r--r--e-util/e-signature.c1
5 files changed, 25 insertions, 28 deletions
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index a19dc879b3..6eba330893 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -25,8 +25,6 @@
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
-
#include <libebackend/e-module.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-xml-utils.h>
@@ -73,7 +71,7 @@ static GHashTable *ep_types;
static GSList *ep_path;
/* global table of plugins by plugin.id */
static GHashTable *ep_plugins;
-/* the list of disabled plugins from gconf */
+/* the list of disabled plugins from GSettings */
static GSList *ep_disabled;
/* All classes which implement EPluginHooks, by class.id */
@@ -108,7 +106,9 @@ static void
ep_set_enabled (const gchar *id,
gint state)
{
- GConfClient *client;
+ GSettings *settings;
+ GSList *l;
+ GPtrArray *array;
/* Bail out if no change to state, when expressed as a boolean: */
if ((state == 0) == (ep_check_enabled (id) == 0))
@@ -126,11 +126,15 @@ ep_set_enabled (const gchar *id,
} else
ep_disabled = g_slist_prepend (ep_disabled, g_strdup (id));
- client = gconf_client_get_default ();
- gconf_client_set_list (
- client, "/apps/evolution/eplugin/disabled",
- GCONF_VALUE_STRING, ep_disabled, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution");
+ array = g_ptr_array_new ();
+ for (l = ep_disabled; l != NULL; l = l->next)
+ g_ptr_array_add (array, l->data);
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (settings, "disabled-eplugins", array->pdata);
+
+ g_ptr_array_free (array, TRUE);
+ g_object_unref (settings);
}
static gint
@@ -523,8 +527,9 @@ plugin_hook_load_subclass (GType type,
gint
e_plugin_load_plugins (void)
{
- GConfClient *client;
+ GSettings *settings;
GSList *l;
+ gchar **strv;
gint i;
if (eph_types != NULL)
@@ -544,11 +549,12 @@ e_plugin_load_plugins (void)
E_TYPE_PLUGIN_HOOK, (ETypeFunc)
plugin_hook_load_subclass, eph_types);
- client = gconf_client_get_default ();
- ep_disabled = gconf_client_get_list (
- client, "/apps/evolution/eplugin/disabled",
- GCONF_VALUE_STRING, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution");
+ strv = g_settings_get_strv (settings, "disabled-eplugins");
+ for (i = 0, ep_disabled = NULL; strv[i] != NULL; i++)
+ ep_disabled = g_slist_append (ep_disabled, g_strdup (strv[i]));
+ g_strfreev (strv);
+ g_object_unref (settings);
for (i = 0; i < 3; i++) {
for (l = ep_path; l; l = g_slist_next (l)) {
diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c
index 037db0fa63..7027682529 100644
--- a/e-util/e-signature-list.c
+++ b/e-util/e-signature-list.c
@@ -264,7 +264,6 @@ free_func (gpointer data,
/**
* e_signature_list_new:
- * @gconf: a #GConfClient
*
* Reads the list of signaturess from @gconf and listens for changes.
* Will emit #signature_added, #signature_changed, and #signature_removed
@@ -278,14 +277,14 @@ free_func (gpointer data,
* Return value: the list of signatures
**/
ESignatureList *
-e_signature_list_new (GConfClient *gconf)
+e_signature_list_new (void)
{
ESignatureList *signature_list;
g_return_val_if_fail (GCONF_IS_CLIENT (gconf), NULL);
signature_list = g_object_new (E_TYPE_SIGNATURE_LIST, NULL);
- e_signature_list_construct (signature_list, gconf);
+ e_signature_list_construct (signature_list, gconf_client_get_default ());
return signature_list;
}
diff --git a/e-util/e-signature-list.h b/e-util/e-signature-list.h
index f2c9df7865..6ea2934b76 100644
--- a/e-util/e-signature-list.h
+++ b/e-util/e-signature-list.h
@@ -27,8 +27,6 @@
#include <libedataserver/e-list.h>
#include <e-util/e-signature.h>
-#include <gconf/gconf-client.h>
-
/* Standard GObject macros */
#define E_TYPE_SIGNATURE_LIST \
(e_signature_list_get_type ())
@@ -72,7 +70,7 @@ struct _ESignatureListClass {
};
GType e_signature_list_get_type (void);
-ESignatureList *e_signature_list_new (GConfClient *client);
+ESignatureList *e_signature_list_new (void);
void e_signature_list_construct (ESignatureList *signature_list,
GConfClient *client);
void e_signature_list_save (ESignatureList *signature_list);
diff --git a/e-util/e-signature-utils.c b/e-util/e-signature-utils.c
index fca51d3799..e7cb88f294 100644
--- a/e-util/e-signature-utils.c
+++ b/e-util/e-signature-utils.c
@@ -26,7 +26,6 @@
#include <errno.h>
#include <camel/camel.h>
#include <glib/gstdio.h>
-#include <gconf/gconf-client.h>
#ifndef G_OS_WIN32
#include <sys/wait.h>
@@ -40,11 +39,7 @@ ESignatureList *
e_get_signature_list (void)
{
if (G_UNLIKELY (global_signature_list == NULL)) {
- GConfClient *client;
-
- client = gconf_client_get_default ();
- global_signature_list = e_signature_list_new (client);
- g_object_unref (client);
+ global_signature_list = e_signature_list_new ();
}
g_return_val_if_fail (global_signature_list != NULL, NULL);
diff --git a/e-util/e-signature.c b/e-util/e-signature.c
index 185378d565..1b49389a82 100644
--- a/e-util/e-signature.c
+++ b/e-util/e-signature.c
@@ -29,7 +29,6 @@
#include <libxml/xmlmemory.h>
#include <glib/gi18n-lib.h>
-#include <gconf/gconf-client.h>
#include <libedataserver/e-uid.h>
#include <libedataserver/e-data-server-util.h>