aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/attachment-reminder/attachment-reminder.c57
-rw-r--r--plugins/external-editor/external-editor.c52
-rw-r--r--plugins/face/face.c14
-rw-r--r--plugins/itip-formatter/itip-formatter.c15
-rw-r--r--plugins/itip-formatter/itip-view.c1
-rw-r--r--plugins/mail-notification/mail-notification.c112
-rw-r--r--plugins/mailing-list-actions/mailing-list-actions.c1
-rw-r--r--plugins/prefer-plain/prefer-plain.c27
-rw-r--r--plugins/save-calendar/rdf-format.c8
-rw-r--r--plugins/templates/templates.c38
10 files changed, 140 insertions, 185 deletions
diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c
index 7a6a9fce55..f2d7382314 100644
--- a/plugins/attachment-reminder/attachment-reminder.c
+++ b/plugins/attachment-reminder/attachment-reminder.c
@@ -28,8 +28,6 @@
#include <glib/gi18n.h>
#include <string.h>
-#include <gconf/gconf-client.h>
-
#include <e-util/e-util.h>
#include <e-util/e-config.h>
#include <mail/em-config.h>
@@ -45,11 +43,11 @@
#include "widgets/misc/e-attachment-view.h"
#include "widgets/misc/e-attachment-store.h"
-#define GCONF_KEY_ATTACH_REMINDER_CLUES "/apps/evolution/mail/attachment_reminder_clues"
+#define CONF_KEY_ATTACH_REMINDER_CLUES "attachment-reminder-clues"
#define SIGNATURE "-- "
typedef struct {
- GConfClient *gconf;
+ GSettings *settings;
GtkWidget *treeview;
GtkWidget *clue_add;
GtkWidget *clue_edit;
@@ -147,21 +145,22 @@ static gboolean
check_for_attachment_clues (gchar *msg)
{
/* TODO : Add more strings. RegEx ??? */
- GConfClient *gconf;
- GSList *clue_list = NULL, *list;
+ GSettings *settings;
+ gchar **clue_list;
+ gint i;
gboolean ret_val = FALSE;
guint msg_length;
- gconf = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.eplugin.attachment-reminder");
- /* Get the list from gconf */
- clue_list = gconf_client_get_list ( gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, NULL );
+ /* Get the list from GSettings */
+ clue_list = g_settings_get_strv (settings, CONF_KEY_ATTACH_REMINDER_CLUES);
- g_object_unref (gconf);
+ g_object_unref (settings);
msg_length = strlen (msg);
- for (list = clue_list; list && !ret_val; list = g_slist_next (list)) {
- gchar *needle = g_utf8_strdown (list->data, -1);
+ for (i = 0; clue_list[i] != NULL; i++) {
+ gchar *needle = g_utf8_strdown (clue_list[i], -1);
if (g_strstr_len (msg, msg_length, needle)) {
ret_val = TRUE;
}
@@ -169,8 +168,7 @@ check_for_attachment_clues (gchar *msg)
}
if (clue_list) {
- g_slist_foreach (clue_list, (GFunc) g_free, NULL);
- g_slist_free (clue_list);
+ g_strfreev (clue_list);
}
return ret_val;
@@ -221,13 +219,15 @@ static void
commit_changes (UIData *ui)
{
GtkTreeModel *model = NULL;
- GSList *clue_list = NULL;
+ GVariantBuilder b;
+ GVariant v;
GtkTreeIter iter;
gboolean valid;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview));
valid = gtk_tree_model_get_iter_first (model, &iter);
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("as"));
while (valid) {
gchar *keyword;
@@ -236,14 +236,14 @@ commit_changes (UIData *ui)
/* Check if the keyword is not empty */
if ((keyword) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0))
- clue_list = g_slist_append (clue_list, keyword);
+ g_variant_builder_add (&b, "s", keyword);
valid = gtk_tree_model_iter_next (model, &iter);
}
- gconf_client_set_list (ui->gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, clue_list, NULL);
+ v = g_variant_builder_end (&b);
+ g_settings_set_value (ui->settings, CONF_KEY_ATTACH_REMINDER_CLUES, v);
- g_slist_foreach (clue_list, (GFunc) g_free, NULL);
- g_slist_free (clue_list);
+ g_variant_unref (v);
}
static void
@@ -388,7 +388,7 @@ destroy_ui_data (gpointer data)
if (!ui)
return;
- g_object_unref (ui->gconf);
+ g_object_unref (ui->settings);
g_free (ui);
}
@@ -398,9 +398,9 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin)
GtkCellRenderer *renderer;
GtkTreeSelection *selection;
GtkTreeIter iter;
- GConfClient *gconf = gconf_client_get_default ();
GtkWidget *hbox;
- GSList *clue_list = NULL, *list;
+ gchar **clue_list;
+ gint i;
GtkWidget *reminder_configuration_box;
GtkWidget *clue_container;
@@ -452,7 +452,7 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin)
gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove);
gtk_widget_set_can_default (clue_remove, TRUE);
- ui->gconf = gconf_client_get_default ();
+ ui->settings = g_settings_new ("org.gnome.evolution.eplugin.attachment-reminder");
ui->treeview = clue_treeview;
@@ -495,17 +495,16 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin)
G_CALLBACK (clue_edit_clicked), ui);
gtk_widget_set_sensitive (ui->clue_edit, FALSE);
- /* Populate tree view with values from gconf */
- clue_list = gconf_client_get_list ( gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, NULL );
+ /* Populate tree view with values from GSettings */
+ clue_list = g_settings_get_strv (ui->settings, CONF_KEY_ATTACH_REMINDER_CLUES);
- for (list = clue_list; list; list = g_slist_next (list)) {
+ for (i = 0; clue_list[i] != NULL; i++) {
gtk_list_store_append (ui->store, &iter);
- gtk_list_store_set (ui->store, &iter, CLUE_KEYWORD_COLUMN, list->data, -1);
+ gtk_list_store_set (ui->store, &iter, CLUE_KEYWORD_COLUMN, clue_list[i], -1);
}
if (clue_list) {
- g_slist_foreach (clue_list, (GFunc) g_free, NULL);
- g_slist_free (clue_list);
+ g_strfreev (clue_list);
}
/* Add the list here */
diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c
index b9386caa87..d2d74797b8 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -43,15 +43,8 @@
#include <stdlib.h>
#include <string.h>
-#include <gconf/gconf-client.h>
-
#define d(x)
-#define EDITOR_GCONF_KEY_COMMAND \
- "/apps/evolution/eplugin/external-editor/editor-command"
-#define EDITOR_GCONF_KEY_IMMEDIATE \
- "/apps/evolution/eplugin/external-editor/launch-on-key-press"
-
gboolean e_plugin_ui_init (GtkUIManager *manager,
EMsgComposer *composer);
GtkWidget * e_plugin_lib_get_configure_widget
@@ -82,29 +75,29 @@ void
ee_editor_command_changed (GtkWidget *textbox)
{
const gchar *editor;
- GConfClient *gconf;
+ GSettings *settings;
editor = gtk_entry_get_text (GTK_ENTRY (textbox));
d(printf ("\n\aeditor is : [%s] \n\a", editor));
- /* gconf access for every key-press. Sucky ? */
- gconf = gconf_client_get_default ();
- gconf_client_set_string (gconf, EDITOR_GCONF_KEY_COMMAND, editor, NULL);
- g_object_unref (gconf);
+ /* GSettings access for every key-press. Sucky ? */
+ settings = g_settings_new ("org.gnome.evolution.eplugin.external-editor");
+ g_settings_set_string (settings, "command", editor);
+ g_object_unref (settings);
}
void
ee_editor_immediate_launch_changed (GtkWidget *checkbox)
{
gboolean immediately;
- GConfClient *gconf;
+ GSettings *settings;
immediately = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
d(printf ("\n\aimmediate launch is : [%d] \n\a", immediately));
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, EDITOR_GCONF_KEY_IMMEDIATE, immediately, NULL);
- g_object_unref (gconf);
+ settings = g_settings_new ("org.gnome.evolution.eplugin.external-editor");
+ g_settings_set_boolean (settings, "launch-on-key-press", immediately);
+ g_object_unref (settings);
}
GtkWidget *
@@ -112,7 +105,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
{
GtkWidget *vbox, *textbox, *label, *help;
GtkWidget *checkbox;
- GConfClient *gconf;
+ GSettings *settings;
gchar *editor;
gboolean checked;
@@ -120,9 +113,9 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
textbox = gtk_entry_new ();
label = gtk_label_new (_("Command to be executed to launch the editor: "));
help = gtk_label_new (_("For Emacs use \"xemacs\"\nFor VI use \"gvim -f\""));
- gconf = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.eplugin.external-editor");
- editor = gconf_client_get_string (gconf, EDITOR_GCONF_KEY_COMMAND, NULL);
+ editor = g_settings_get_string (settings, "command");
if (editor) {
gtk_entry_set_text (GTK_ENTRY (textbox), editor);
g_free (editor);
@@ -130,10 +123,10 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
checkbox = gtk_check_button_new_with_label (
_("Automatically launch when a new mail is edited"));
- checked = gconf_client_get_bool (gconf, EDITOR_GCONF_KEY_IMMEDIATE, NULL);
+ checked = g_settings_get_boolean (settings, "launch-on-key-press");
if (checked)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
- g_object_unref (gconf);
+ g_object_unref (settings);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), textbox, FALSE, FALSE, 0);
@@ -261,7 +254,7 @@ async_external_editor (EMsgComposer *composer)
{
gchar *filename = NULL;
gint status = 0;
- GConfClient *gconf;
+ GSettings *settings;
gchar *editor_cmd_line = NULL, *editor_cmd = NULL, *content;
gint fd, position = -1, offset = -1;
@@ -289,9 +282,8 @@ async_external_editor (EMsgComposer *composer)
return;
}
- gconf = gconf_client_get_default ();
- editor_cmd = gconf_client_get_string (
- gconf, EDITOR_GCONF_KEY_COMMAND, NULL);
+ settings = g_settings_new ("org.gnome.evolution.eplugin.external-editor");
+ editor_cmd = g_settings_get_string (settings, "command");
if (!editor_cmd) {
if (!(editor_cmd = g_strdup (g_getenv ("EDITOR"))) )
/* Make gedit the default external editor,
@@ -299,7 +291,7 @@ async_external_editor (EMsgComposer *composer)
* and no $EDITOR is set. */
editor_cmd = g_strdup ("gedit");
}
- g_object_unref (gconf);
+ g_object_unref (settings);
if (g_strrstr (editor_cmd, "vim") != NULL
&& gtk_html_get_cursor_pos (
@@ -410,7 +402,7 @@ key_press_cb (GtkWidget *widget,
GdkEventKey *event,
EMsgComposer *composer)
{
- GConfClient *gconf;
+ GSettings *settings;
gboolean immediately;
/* we don't want to start the editor on any modifier keys */
@@ -426,9 +418,9 @@ key_press_cb (GtkWidget *widget,
break;
}
- gconf = gconf_client_get_default ();
- immediately = gconf_client_get_bool (gconf, EDITOR_GCONF_KEY_IMMEDIATE, NULL);
- g_object_unref (gconf);
+ settings = g_settings_new ("org.gnome.evolution.eplugin.external-editor");
+ immediately = g_settings_get_boolean (settings, "launch-on-key-press");
+ g_object_unref (settings);
if (!immediately)
return FALSE;
diff --git a/plugins/face/face.c b/plugins/face/face.c
index df9eafcd5a..d344548e45 100644
--- a/plugins/face/face.c
+++ b/plugins/face/face.c
@@ -35,17 +35,17 @@
#define d(x)
-#define SETTINGS_KEY "/apps/evolution/eplugin/face/insert_by_default"
+#define SETTINGS_KEY "insert-face-picture"
static gboolean
get_include_face_by_default (void)
{
- GConfClient *gconf = gconf_client_get_default ();
+ GSettings *settings = g_settings_new ("org.gnome.evolution.eplugin.face-picture");
gboolean res;
- res = gconf_client_get_bool (gconf, SETTINGS_KEY, NULL);
+ res = g_settings_get_boolean (settings, SETTINGS_KEY);
- g_object_unref (gconf);
+ g_object_unref (settings);
return res;
}
@@ -53,11 +53,11 @@ get_include_face_by_default (void)
static void
set_include_face_by_default (gboolean value)
{
- GConfClient *gconf = gconf_client_get_default ();
+ GSettings *settings = g_settings_new ("org.gnome.evolution.eplugin.face-picture");
- gconf_client_set_bool (gconf, SETTINGS_KEY, value, NULL);
+ g_settings_set_boolean (settings, SETTINGS_KEY, value);
- g_object_unref (gconf);
+ g_object_unref (settings);
}
static gchar *
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 72535a3a99..d9ec622f6e 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -27,7 +27,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
#include <libecal/e-cal-client.h>
#include <libecal/e-cal-time-util.h>
#include <libedataserverui/e-source-selector.h>
@@ -51,7 +50,7 @@
#include <misc/e-attachment.h>
#define CLASSID "itip://"
-#define GCONF_KEY_DELETE "/apps/evolution/itip/delete_processed"
+#define CONF_KEY_DELETE "delete-processed"
#define d(x)
@@ -2888,7 +2887,7 @@ void
format_itip (EPlugin *ep,
EMFormatHookTarget *target)
{
- GConfClient *gconf;
+ GSettings *settings;
gchar *classid;
struct _itip_puri *puri;
CamelDataWrapper *content;
@@ -2907,8 +2906,8 @@ format_itip (EPlugin *ep,
em_format_html_add_pobject ((EMFormatHTML *) target->format, sizeof (EMFormatHTMLPObject), classid, target->part, format_itip_object);
- gconf = gconf_client_get_default ();
- puri->delete_message = gconf_client_get_bool (gconf, GCONF_KEY_DELETE, NULL);
+ settings = g_settings_new ("org.gnome.evolution.eplugin.itip");
+ puri->delete_message = g_settings_get_boolean (settings, CONF_KEY_DELETE);
puri->has_organizer = FALSE;
puri->no_reply_wanted = FALSE;
puri->folder = ((EMFormat *) target->format)->folder;
@@ -2918,7 +2917,7 @@ format_itip (EPlugin *ep,
puri->cancellable = g_cancellable_new ();
puri->puri.free = puri_free;
- g_object_unref (gconf);
+ g_object_unref (settings);
/* This is non-gui thread. Download the part for using in the main thread */
content = camel_medium_get_content ((CamelMedium *) target->part);
@@ -2952,7 +2951,7 @@ delete_toggled_cb (GtkWidget *widget,
{
EMConfigTargetPrefs *target = data;
- gconf_client_set_bool (target->gconf, GCONF_KEY_DELETE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), NULL);
+ g_settings_set_boolean (target->settings, CONF_KEY_DELETE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
}
static void
@@ -3053,7 +3052,7 @@ itip_formatter_page_factory (EPlugin *ep,
/* Delete message after acting */
/* FIXME Need a schema for this */
check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gconf_client_get_bool (target->gconf, GCONF_KEY_DELETE, NULL));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (target->settings, CONF_KEY_DELETE));
g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (delete_toggled_cb), target);
gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0);
diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c
index 5163d25e02..fd4190b593 100644
--- a/plugins/itip-formatter/itip-view.c
+++ b/plugins/itip-formatter/itip-view.c
@@ -26,7 +26,6 @@
#include <string.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
#include <libedataserver/e-time-utils.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserverui/e-source-combo-box.h>
diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c
index d41f492292..f389a2e678 100644
--- a/plugins/mail-notification/mail-notification.c
+++ b/plugins/mail-notification/mail-notification.c
@@ -27,7 +27,6 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
#include <gio/gio.h>
#ifdef HAVE_CANBERRA
@@ -37,7 +36,6 @@
#include <time.h>
#include <e-util/e-config.h>
-#include <e-util/gconf-bridge.h>
#include <mail/e-mail-folder-utils.h>
#include <mail/em-utils.h>
#include <mail/em-event.h>
@@ -48,11 +46,10 @@
#include <libnotify/notify.h>
#endif
-#define GCONF_KEY_ROOT "/apps/evolution/eplugin/mail-notification/"
-#define GCONF_KEY_NOTIFY_ONLY_INBOX GCONF_KEY_ROOT "notify-only-inbox"
-#define GCONF_KEY_ENABLED_STATUS GCONF_KEY_ROOT "status-enabled"
-#define GCONF_KEY_STATUS_NOTIFICATION GCONF_KEY_ROOT "status-notification"
-#define GCONF_KEY_ENABLED_SOUND GCONF_KEY_ROOT "sound-enabled"
+#define CONF_KEY_NOTIFY_ONLY_INBOX "notify-only-inbox"
+#define CONF_KEY_ENABLED_STATUS "notify-status-enabled"
+#define CONF_KEY_STATUS_NOTIFICATION "notify-status-notification"
+#define CONF_KEY_ENABLED_SOUND "notify-sound-enabled"
static gboolean enabled = FALSE;
static GtkWidget *get_cfg_widget (void);
@@ -72,7 +69,7 @@ static GStaticMutex mlock = G_STATIC_MUTEX_INIT;
* d) GtkWidget *get_config_widget_...(void)
* to obtain config widget for the particular part
*
- * It also should have its own gconf key for enabled state. In each particular
+ * It also should have its own GSettings key for enabled state. In each particular
* function it should do its work as expected. enable_... will be called always
* when disabling plugin, but only when enabling/disabling part itself.
**/
@@ -82,22 +79,17 @@ static GStaticMutex mlock = G_STATIC_MUTEX_INIT;
/* ------------------------------------------------------------------- */
static gboolean
-is_part_enabled (const gchar *gconf_key)
+is_part_enabled (const gchar *key)
{
/* the part is enabled by default */
gboolean res = TRUE;
- GConfClient *client;
- GConfValue *is_key;
+ GSettings *settings;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.eplugin.mail-notification");
- is_key = gconf_client_get (client, gconf_key, NULL);
- if (is_key) {
- res = gconf_client_get_bool (client, gconf_key, NULL);
- gconf_value_free (is_key);
- }
+ res = g_settings_get_boolean (settings, key);
- g_object_unref (client);
+ g_object_unref (settings);
return res;
}
@@ -503,10 +495,10 @@ read_notify_status (EMEventTargetMessage *t)
/* min no. seconds between newmail notifications */
#define NOTIFY_THROTTLE 30
-#define GCONF_KEY_SOUND_BEEP GCONF_KEY_ROOT "sound-beep"
-#define GCONF_KEY_SOUND_FILE GCONF_KEY_ROOT "sound-file"
-#define GCONF_KEY_SOUND_PLAY_FILE GCONF_KEY_ROOT "sound-play-file"
-#define GCONF_KEY_SOUND_USE_THEME GCONF_KEY_ROOT "sound-use-theme"
+#define CONF_KEY_SOUND_BEEP "notify-sound-beep"
+#define CONF_KEY_SOUND_FILE "notify-sound-file"
+#define CONF_KEY_SOUND_PLAY_FILE "notify-sound-play-file"
+#define CONF_KEY_SOUND_USE_THEME "notify-sound-use-theme"
#ifdef HAVE_CANBERRA
static ca_context *mailnotification = NULL;
@@ -544,16 +536,14 @@ sound_file_set_cb (GtkFileChooser *file_chooser,
gpointer data)
{
gchar *file;
- GConfClient *client;
+ GSettings *settings;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.eplugin.mail-notification");
file = gtk_file_chooser_get_filename (file_chooser);
- gconf_client_set_string (
- client, GCONF_KEY_SOUND_FILE,
- (file != NULL) ? file : "", NULL);
+ g_settings_set_string (settings, CONF_KEY_SOUND_FILE, (file != NULL) ? file : "");
- g_object_unref (client);
+ g_object_unref (settings);
g_free (file);
}
@@ -585,20 +575,20 @@ static gboolean
sound_notify_idle_cb (gpointer user_data)
{
gchar *file;
- GConfClient *client;
+ GSettings *settings;
struct _SoundNotifyData *data = (struct _SoundNotifyData *) user_data;
g_return_val_if_fail (data != NULL, FALSE);
- client = gconf_client_get_default ();
- file = gconf_client_get_string (client, GCONF_KEY_SOUND_FILE, NULL);
+ settings = g_settings_new ("org.gnome.evolution.eplugin.mail-notification");
+ file = g_settings_get_string (settings, CONF_KEY_SOUND_FILE);
do_play_sound (
- is_part_enabled (GCONF_KEY_SOUND_BEEP),
- is_part_enabled (GCONF_KEY_SOUND_USE_THEME),
+ is_part_enabled (CONF_KEY_SOUND_BEEP),
+ is_part_enabled (CONF_KEY_SOUND_USE_THEME),
file);
- g_object_unref (client);
+ g_object_unref (settings);
g_free (file);
time (&data->last_notify);
@@ -656,14 +646,11 @@ get_config_widget_sound (void)
GtkWidget *master;
GtkWidget *widget;
gchar *file;
- GConfBridge *bridge;
- GConfClient *client;
+ GSettings *settings;
GSList *group = NULL;
struct _SoundConfigureWidgets *scw;
const gchar *text;
- bridge = gconf_bridge_get ();
-
scw = g_malloc0 (sizeof (struct _SoundConfigureWidgets));
vbox = gtk_vbox_new (FALSE, 6);
@@ -676,9 +663,9 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- gconf_bridge_bind_property (
- bridge, GCONF_KEY_ENABLED_SOUND,
- G_OBJECT (widget), "active");
+ settings = g_settings_new ("org.gnome.evolution.eplugin.mail-notification");
+
+ g_settings_bind (settings, CONF_KEY_ENABLED_SOUND, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
master = widget;
scw->enable = GTK_TOGGLE_BUTTON (widget);
@@ -706,9 +693,7 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- gconf_bridge_bind_property (
- bridge, GCONF_KEY_SOUND_BEEP,
- G_OBJECT (widget), "active");
+ g_settings_bind (settings, CONF_KEY_SOUND_BEEP, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
scw->beep = GTK_TOGGLE_BUTTON (widget);
@@ -719,9 +704,7 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- gconf_bridge_bind_property (
- bridge, GCONF_KEY_SOUND_USE_THEME,
- G_OBJECT (widget), "active");
+ g_settings_bind (settings, CONF_KEY_SOUND_USE_THEME, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
scw->use_theme = GTK_TOGGLE_BUTTON (widget);
@@ -738,9 +721,7 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- gconf_bridge_bind_property (
- bridge, GCONF_KEY_SOUND_PLAY_FILE,
- G_OBJECT (widget), "active");
+ g_settings_bind (settings, CONF_KEY_SOUND_PLAY_FILE, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
text = _("Select sound file");
widget = gtk_file_chooser_button_new (
@@ -761,13 +742,12 @@ get_config_widget_sound (void)
widget, "clicked",
G_CALLBACK (sound_play_cb), scw);
- client = gconf_client_get_default ();
- file = gconf_client_get_string (client, GCONF_KEY_SOUND_FILE, NULL);
+ file = g_settings_get_string (settings, CONF_KEY_SOUND_FILE);
if (file && *file)
gtk_file_chooser_set_filename (scw->filechooser, file);
- g_object_unref (client);
+ g_object_unref (settings);
g_free (file);
g_signal_connect (
@@ -789,10 +769,10 @@ get_cfg_widget (void)
{
GtkWidget *container;
GtkWidget *widget;
- GConfBridge *bridge;
+ GSettings *settings;
const gchar *text;
- bridge = gconf_bridge_get ();
+ settings = g_settings_new ("org.gnome.evolution.eplugin.mail-notification");
widget = gtk_vbox_new (FALSE, 12);
gtk_widget_show (widget);
@@ -804,9 +784,7 @@ get_cfg_widget (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- gconf_bridge_bind_property (
- bridge, GCONF_KEY_NOTIFY_ONLY_INBOX,
- G_OBJECT (widget), "active");
+ g_settings_bind (settings, CONF_KEY_NOTIFY_ONLY_INBOX, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
#ifdef HAVE_LIBNOTIFY
text = _("Show _notification when a new message arrives");
@@ -814,14 +792,14 @@ get_cfg_widget (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- gconf_bridge_bind_property (
- bridge, GCONF_KEY_ENABLED_STATUS,
- G_OBJECT (widget), "active");
+ g_settings_bind (settings, CONF_KEY_ENABLED_STATUS, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
#endif
widget = get_config_widget_sound ();
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ g_object_unref (settings);
+
return container;
}
@@ -838,7 +816,7 @@ org_gnome_mail_new_notify (EPlugin *ep,
g_return_if_fail (t != NULL);
if (!enabled || !t->new || (!t->is_inbox &&
- is_part_enabled (GCONF_KEY_NOTIFY_ONLY_INBOX)))
+ is_part_enabled (CONF_KEY_NOTIFY_ONLY_INBOX)))
return;
g_static_mutex_lock (&mlock);
@@ -846,11 +824,11 @@ org_gnome_mail_new_notify (EPlugin *ep,
new_notify_dbus (t);
#ifdef HAVE_LIBNOTIFY
- if (is_part_enabled (GCONF_KEY_ENABLED_STATUS))
+ if (is_part_enabled (CONF_KEY_ENABLED_STATUS))
new_notify_status (t);
#endif
- if (is_part_enabled (GCONF_KEY_ENABLED_SOUND))
+ if (is_part_enabled (CONF_KEY_ENABLED_SOUND))
new_notify_sound (t);
g_static_mutex_unlock (&mlock);
@@ -870,11 +848,11 @@ org_gnome_mail_read_notify (EPlugin *ep,
read_notify_dbus (t);
#ifdef HAVE_LIBNOTIFY
- if (is_part_enabled (GCONF_KEY_ENABLED_STATUS))
+ if (is_part_enabled (CONF_KEY_ENABLED_STATUS))
read_notify_status (t);
#endif
- if (is_part_enabled (GCONF_KEY_ENABLED_SOUND))
+ if (is_part_enabled (CONF_KEY_ENABLED_SOUND))
read_notify_sound (t);
g_static_mutex_unlock (&mlock);
@@ -887,7 +865,7 @@ e_plugin_lib_enable (EPlugin *ep,
if (enable) {
enable_dbus (enable);
- if (is_part_enabled (GCONF_KEY_ENABLED_SOUND))
+ if (is_part_enabled (CONF_KEY_ENABLED_SOUND))
enable_sound (enable);
enabled = TRUE;
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c
index e9d2dda7ee..8e849be972 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -28,7 +28,6 @@
#include <stdio.h>
#include <string.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
#include "composer/e-msg-composer.h"
#include "mail/e-mail-browser.h"
diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c
index 55f62f8e3d..907e562c29 100644
--- a/plugins/prefer-plain/prefer-plain.c
+++ b/plugins/prefer-plain/prefer-plain.c
@@ -26,7 +26,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
-#include <gconf/gconf-client.h>
#include <string.h>
#include <stdio.h>
@@ -44,7 +43,7 @@ enum {
EPP_TEXT
};
-static GConfClient *epp_gconf = NULL;
+static GSettings *epp_settings = NULL;
static gint epp_mode = -1;
static gboolean epp_show_suppressed = TRUE;
@@ -281,7 +280,7 @@ epp_mode_changed (GtkComboBox *dropdown,
if (epp_mode > 2)
epp_mode = 0;
- gconf_client_set_string(epp_gconf, "/apps/evolution/eplugin/prefer_plain/mode", epp_options[epp_mode].key, NULL);
+ g_settings_set_string (epp_settings, "mode", epp_options[epp_mode].key);
update_info_label (info_label, epp_mode);
}
@@ -292,7 +291,7 @@ epp_show_suppressed_toggled (GtkToggleButton *check,
g_return_if_fail (check != NULL);
epp_show_suppressed = gtk_toggle_button_get_active (check);
- gconf_client_set_bool (epp_gconf, "/apps/evolution/eplugin/prefer_plain/show_suppressed", epp_show_suppressed, NULL);
+ g_settings_set_boolean (epp_settings, "show-suppressed", epp_show_suppressed);
}
GtkWidget *
@@ -363,14 +362,13 @@ e_plugin_lib_enable (EPlugin *ep,
gchar *key;
gint i;
- if (epp_gconf || epp_mode != -1)
+ if (epp_settings || epp_mode != -1)
return 0;
if (enable) {
- GConfValue *val;
- epp_gconf = gconf_client_get_default ();
- key = gconf_client_get_string(epp_gconf, "/apps/evolution/eplugin/prefer_plain/mode", NULL);
+ epp_settings = g_settings_new ("org.gnome.evolution.eplugin.prefer-plain");
+ key = g_settings_get_string (epp_settings, "mode");
if (key) {
for (i = 0; i < G_N_ELEMENTS (epp_options); i++) {
if (!strcmp (epp_options[i].key, key)) {
@@ -383,16 +381,11 @@ e_plugin_lib_enable (EPlugin *ep,
epp_mode = 0;
}
- val = gconf_client_get (epp_gconf, "/apps/evolution/eplugin/prefer_plain/show_suppressed", NULL);
- if (val) {
- epp_show_suppressed = gconf_value_get_bool (val);
- gconf_value_free (val);
- } else
- epp_show_suppressed = TRUE;
+ epp_show_suppressed = g_settings_get_boolean (epp_settings, "show-suppressed");
} else {
- if (epp_gconf) {
- g_object_unref (epp_gconf);
- epp_gconf = NULL;
+ if (epp_settings) {
+ g_object_unref (epp_settings);
+ epp_settings = NULL;
}
}
diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c
index c93eb1fb59..ed9cf18bb6 100644
--- a/plugins/save-calendar/rdf-format.c
+++ b/plugins/save-calendar/rdf-format.c
@@ -59,13 +59,11 @@ static GConfClient *config = NULL;
static gchar *
calendar_config_get_timezone (void)
{
-
+ GSettings *settings;
gchar *retval = NULL;
- if (!config)
- config = gconf_client_get_default ();
-
- retval = gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL);
+ settings = g_settings_new ("org.gnome.evolution.calendar");
+ retval = g_settings_get_string (settings, "timezone");
if (!retval)
retval = g_strdup ("UTC");
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index f68cfc1b26..b3e112edb5 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -30,8 +30,6 @@
#include <glib/gi18n.h>
#include <string.h>
-#include <gconf/gconf-client.h>
-
#include <e-util/e-config.h>
#include <mail/e-mail-folder-utils.h>
@@ -49,7 +47,7 @@
#include <composer/e-msg-composer.h>
-#define GCONF_KEY_TEMPLATE_PLACEHOLDERS "/apps/evolution/mail/template_placeholders"
+#define KEY_TEMPLATE_PLACEHOLDERS "template-placeholders"
typedef struct _AsyncContext AsyncContext;
@@ -63,7 +61,7 @@ struct _AsyncContext {
};
typedef struct {
- GConfClient *gconf;
+ GSettings *settings;
GtkWidget *treeview;
GtkWidget *clue_add;
GtkWidget *clue_edit;
@@ -149,7 +147,7 @@ destroy_ui_data (gpointer data)
if (!ui)
return;
- g_object_unref (ui->gconf);
+ g_object_unref (ui->settings);
g_free (ui);
}
@@ -157,13 +155,15 @@ static void
commit_changes (UIData *ui)
{
GtkTreeModel *model = NULL;
- GSList *clue_list = NULL;
+ GVariantBuilder b;
GtkTreeIter iter;
gboolean valid;
+ GVariant *v;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview));
valid = gtk_tree_model_get_iter_first (model, &iter);
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("as"));
while (valid) {
gchar *keyword, *value;
gchar *key;
@@ -175,15 +175,14 @@ commit_changes (UIData *ui)
if ((keyword) && (value) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0)
&& (g_utf8_strlen (g_strstrip (value), -1) > 0)) {
key = g_strdup_printf("%s=%s", keyword, value);
- clue_list = g_slist_append (clue_list, key);
+ g_variant_builder_add (&b, "s", key);
}
valid = gtk_tree_model_iter_next (model, &iter);
}
- gconf_client_set_list (ui->gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, clue_list, NULL);
-
- g_slist_foreach (clue_list, (GFunc) g_free, NULL);
- g_slist_free (clue_list);
+ v = g_variant_builder_end (&b);
+ g_settings_set_value (ui->settings, CONF_KEY_TEMPLATE_PLACEHOLDERS, v);
+ g_variant_unref (v);
}
static void
@@ -396,9 +395,9 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
GtkCellRenderer *renderer_key, *renderer_value;
GtkTreeSelection *selection;
GtkTreeIter iter;
- GConfClient *gconf = gconf_client_get_default ();
GtkWidget *hbox;
- GSList *clue_list = NULL, *list;
+ gchar **clue_list;
+ gint i;
GtkTreeModel *model;
GtkWidget *templates_configuration_box;
GtkWidget *clue_container;
@@ -450,7 +449,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove);
gtk_widget_set_can_default (clue_remove, TRUE);
- ui->gconf = gconf_client_get_default ();
+ ui->settings = g_settings_new ("org.gnome.evolution.eplugin.templates");
ui->treeview = clue_treeview;
@@ -499,19 +498,18 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
model, "row-changed",
G_CALLBACK (clue_check_isempty), ui);
- /* Populate tree view with values from gconf */
- clue_list = gconf_client_get_list ( gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, NULL );
+ /* Populate tree view with values from GSettings */
+ clue_list = g_settings_get_strv (ui->settings, CONF_KEY_TEMPLATE_PLACEHOLDERS);
- for (list = clue_list; list; list = g_slist_next (list)) {
- gchar **temp = g_strsplit (list->data, "=", 2);
+ for (i = 0; clue_list[i] != NULL; i++) {
+ gchar **temp = g_strsplit (clue_list[i], "=", 2);
gtk_list_store_append (ui->store, &iter);
gtk_list_store_set (ui->store, &iter, CLUE_KEYWORD_COLUMN, temp[0], CLUE_VALUE_COLUMN, temp[1], -1);
g_strfreev (temp);
}
if (clue_list) {
- g_slist_foreach (clue_list, (GFunc) g_free, NULL);
- g_slist_free (clue_list);
+ g_strfreev (clue_list);
}
/* Add the list here */