aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mail')
-rw-r--r--modules/mail/e-mail-shell-backend.c60
-rw-r--r--modules/mail/e-mail-shell-settings.c174
-rw-r--r--modules/mail/e-mail-shell-view-actions.c16
-rw-r--r--modules/mail/em-mailer-prefs.c117
-rw-r--r--modules/mail/em-mailer-prefs.h3
5 files changed, 196 insertions, 174 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index b729a00832..5ea75ee5b4 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -476,17 +476,15 @@ mail_shell_backend_delete_junk_policy_decision (EMailBackend *backend)
{
EShell *shell;
EShellSettings *shell_settings;
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
gboolean delete_junk;
gint empty_date;
gint empty_days;
gint now;
- GError *error = NULL;
shell = e_shell_backend_get_shell (E_SHELL_BACKEND (backend));
- client = e_shell_get_gconf_client (shell);
+ settings = g_settings_new ("org.gnome.evolution.mail");
shell_settings = e_shell_get_shell_settings (shell);
now = time (NULL) / 60 / 60 / 24;
@@ -499,32 +497,18 @@ mail_shell_backend_delete_junk_policy_decision (EMailBackend *backend)
empty_date = empty_days = 0;
if (delete_junk) {
- key = "/apps/evolution/mail/junk/empty_on_exit_days";
- empty_days = gconf_client_get_int (client, key, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- return FALSE;
- }
- }
-
- if (delete_junk) {
- key = "/apps/evolution/mail/junk/empty_date";
- empty_date = gconf_client_get_int (client, key, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- return FALSE;
- }
+ empty_days = g_settings_get_int (settings, "junk-empty-on-exit-days");
+ empty_date = g_settings_get_int (settings, "junk-empty-date");
}
delete_junk &= (empty_days == 0) || (empty_date + empty_days <= now);
if (delete_junk) {
- key = "/apps/evolution/mail/junk/empty_date";
- gconf_client_set_int (client, key, now, NULL);
+ g_settings_set_int (settings, "junk-empty-date", now);
}
+ g_object_unref (settings);
+
return delete_junk;
}
@@ -533,17 +517,15 @@ mail_shell_backend_empty_trash_policy_decision (EMailBackend *backend)
{
EShell *shell;
EShellSettings *shell_settings;
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
gboolean empty_trash;
gint empty_date;
gint empty_days;
gint now;
- GError *error = NULL;
shell = e_shell_backend_get_shell (E_SHELL_BACKEND (backend));
- client = e_shell_get_gconf_client (shell);
+ settings = g_settings_new ("org.gnome.evolution.mail");
shell_settings = e_shell_get_shell_settings (shell);
now = time (NULL) / 60 / 60 / 24;
@@ -556,32 +538,18 @@ mail_shell_backend_empty_trash_policy_decision (EMailBackend *backend)
empty_date = empty_days = 0;
if (empty_trash) {
- key = "/apps/evolution/mail/trash/empty_on_exit_days";
- empty_days = gconf_client_get_int (client, key, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- return FALSE;
- }
- }
-
- if (empty_trash) {
- key = "/apps/evolution/mail/trash/empty_date";
- empty_date = gconf_client_get_int (client, key, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- return FALSE;
- }
+ empty_days = g_settings_get_int (settings, "trash-empty-on-exit-days");
+ empty_date = g_settings_get_int (settings, "trash-empty-date");
}
empty_trash &= (empty_days == 0) || (empty_date + empty_days <= now);
if (empty_trash) {
- key = "/apps/evolution/mail/trash/empty_date";
- gconf_client_set_int (client, key, now, NULL);
+ g_settings_set_int (settings, "trash-empty-date", now);
}
+ g_object_unref (settings);
+
return empty_trash;
}
diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c
index 6b0cee6826..7fe3fc0342 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -32,6 +32,8 @@
#include <shell/e-shell.h>
+#define MAIL_SCHEMA "org.gnome.evolution.mail"
+
static gboolean
transform_no_folder_dots_to_ellipsize (GBinding *binding,
const GValue *source_value,
@@ -95,243 +97,301 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
e_shell_settings_install_property_for_key (
"mail-address-compress",
- "/apps/evolution/mail/display/address_compress");
+ MAIL_SCHEMA,
+ "address-compress");
e_shell_settings_install_property_for_key (
"mail-address-count",
- "/apps/evolution/mail/display/address_count");
+ MAIL_SCHEMA,
+ "address-count");
e_shell_settings_install_property_for_key (
"mail-charset",
- "/apps/evolution/mail/display/charset");
+ MAIL_SCHEMA,
+ "charset");
e_shell_settings_install_property_for_key (
"mail-check-for-junk",
- "/apps/evolution/mail/junk/check_incoming");
+ MAIL_SCHEMA,
+ "junk-check-incoming");
e_shell_settings_install_property_for_key (
"mail-check-on-start",
- "/apps/evolution/mail/send_recv_on_start");
+ MAIL_SCHEMA,
+ "send-recv-on-start");
e_shell_settings_install_property_for_key (
"mail-check-all-on-start",
- "/apps/evolution/mail/send_recv_all_on_start");
+ MAIL_SCHEMA,
+ "send-recv-all-on-start");
e_shell_settings_install_property_for_key (
"mail-citation-color",
- "/apps/evolution/mail/display/citation_colour");
+ MAIL_SCHEMA,
+ "citation-colour");
e_shell_settings_install_property_for_key (
"mail-confirm-expunge",
- "/apps/evolution/mail/prompts/expunge");
+ MAIL_SCHEMA,
+ "prompt-on-expunge");
e_shell_settings_install_property_for_key (
"mail-confirm-unwanted-html",
- "/apps/evolution/mail/prompts/unwanted_html");
+ MAIL_SCHEMA,
+ "prompt-on-unwanted-html");
e_shell_settings_install_property_for_key (
"mail-empty-junk-on-exit",
- "/apps/evolution/mail/junk/empty_on_exit");
+ MAIL_SCHEMA,
+ "junk-empty-on-exit");
e_shell_settings_install_property_for_key (
"mail-empty-trash-on-exit",
- "/apps/evolution/mail/trash/empty_on_exit");
+ MAIL_SCHEMA,
+ "trash-empty-on-exit");
e_shell_settings_install_property_for_key (
"mail-enable-search-folders",
- "/apps/evolution/mail/display/enable_vfolders");
+ MAIL_SCHEMA,
+ "enable-vfolders");
e_shell_settings_install_property_for_key (
"mail-enable-local-folders",
- "/apps/evolution/mail/display/enable_local");
+ MAIL_SCHEMA,
+ "enable-local");
e_shell_settings_install_property_for_key (
"mail-font-monospace",
- "/apps/evolution/mail/display/fonts/monospace");
+ MAIL_SCHEMA,
+ "monospace-font");
e_shell_settings_install_property_for_key (
"mail-font-variable",
- "/apps/evolution/mail/display/fonts/variable");
+ MAIL_SCHEMA,
+ "variable-width-font");
e_shell_settings_install_property_for_key (
"mail-force-message-limit",
- "/apps/evolution/mail/display/force_message_limit");
+ MAIL_SCHEMA,
+ "force-message-limit");
/* This value corresponds to the EMailForwardStyle enum. */
e_shell_settings_install_property_for_key (
"mail-forward-style",
- "/apps/evolution/mail/format/forward_style");
+ MAIL_SCHEMA,
+ "forward-style");
/* This value corresponds to MailConfigHTTPMode enum. */
e_shell_settings_install_property_for_key (
"mail-image-loading-policy",
- "/apps/evolution/mail/display/load_http_images");
+ MAIL_SCHEMA,
+ "load-http-images");
e_shell_settings_install_property_for_key (
"mail-magic-spacebar",
- "/apps/evolution/mail/display/magic_spacebar");
+ MAIL_SCHEMA,
+ "magic-spacebar");
e_shell_settings_install_property_for_key (
"mail-global-view-setting",
- "/apps/evolution/mail/display/global_view_setting");
+ MAIL_SCHEMA,
+ "global-view-setting");
e_shell_settings_install_property_for_key (
"mail-mark-citations",
- "/apps/evolution/mail/display/mark_citations");
+ MAIL_SCHEMA,
+ "mark-citations");
e_shell_settings_install_property_for_key (
"mail-mark-seen",
- "/apps/evolution/mail/display/mark_seen");
+ MAIL_SCHEMA,
+ "mark-seen");
e_shell_settings_install_property_for_key (
"mail-mark-seen-timeout",
- "/apps/evolution/mail/display/mark_seen_timeout");
+ MAIL_SCHEMA,
+ "mark-seen-timeout");
e_shell_settings_install_property_for_key (
"mail-message-text-part-limit",
- "/apps/evolution/mail/display/message_text_part_limit");
+ MAIL_SCHEMA,
+ "message-text-part-limit");
/* Do not bind to this. Use "mail-sidebar-ellipsize" instead. */
e_shell_settings_install_property_for_key (
"mail-no-folder-dots",
- "/apps/evolution/mail/display/no_folder_dots");
+ MAIL_SCHEMA,
+ "no-folder-dots");
e_shell_settings_install_property_for_key (
"mail-only-local-photos",
- "/apps/evolution/mail/display/photo_local");
+ MAIL_SCHEMA,
+ "photo-local");
e_shell_settings_install_property_for_key (
"mail-show-real-date",
- "/apps/evolution/mail/display/show_real_date");
+ MAIL_SCHEMA,
+ "show-real-date");
e_shell_settings_install_property_for_key (
"mail-sort-accounts-alpha",
- "/apps/evolution/mail/display/sort_accounts_alpha");
+ MAIL_SCHEMA,
+ "sort-accounts-alpha");
e_shell_settings_install_property_for_key (
"mail-prompt-delete-in-vfolder",
- "/apps/evolution/mail/prompts/delete_in_vfolder");
+ MAIL_SCHEMA,
+ "prompt-on-delete-in-vfolder");
/* This value corresponds to the EMailReplyStyle enum,
* but the ordering of the combo box items in preferences
* has changed. We use transformation functions there. */
e_shell_settings_install_property_for_key (
"mail-reply-style",
- "/apps/evolution/mail/format/reply_style");
+ MAIL_SCHEMA,
+ "reply-style");
e_shell_settings_install_property_for_key (
"mail-safe-list",
- "/apps/evolution/mail/display/safe_list");
+ MAIL_SCHEMA,
+ "safe-list");
e_shell_settings_install_property_for_key (
"mail-show-animated-images",
- "/apps/evolution/mail/display/animated_images");
+ MAIL_SCHEMA,
+ "show-animated-images");
e_shell_settings_install_property_for_key (
"mail-show-sender-photo",
- "/apps/evolution/mail/display/sender_photo");
+ MAIL_SCHEMA,
+ "show-sender-photo");
e_shell_settings_install_property_for_key (
"mail-sidebar-search",
- "/apps/evolution/mail/display/side_bar_search");
+ MAIL_SCHEMA,
+ "side-bar-search");
e_shell_settings_install_property_for_key (
"mail-thread-by-subject",
- "/apps/evolution/mail/display/thread_subject");
+ MAIL_SCHEMA,
+ "thread-subject");
e_shell_settings_install_property_for_key (
"mail-use-custom-fonts",
- "/apps/evolution/mail/display/fonts/use_custom");
+ MAIL_SCHEMA,
+ "use-custom-font");
/*** Composer Preferences ***/
e_shell_settings_install_property_for_key (
"composer-charset",
- "/apps/evolution/mail/composer/charset");
+ MAIL_SCHEMA,
+ "composer-charset");
e_shell_settings_install_property_for_key (
"composer-format-html",
- "/apps/evolution/mail/composer/send_html");
+ MAIL_SCHEMA,
+ "composer-send-html");
e_shell_settings_install_property_for_key (
"composer-inline-spelling",
- "/apps/evolution/mail/composer/inline_spelling");
+ MAIL_SCHEMA,
+ "composer-inline-spelling");
e_shell_settings_install_property_for_key (
"composer-magic-links",
- "/apps/evolution/mail/composer/magic_links");
+ MAIL_SCHEMA,
+ "composer-magic-links");
e_shell_settings_install_property_for_key (
"composer-magic-smileys",
- "/apps/evolution/mail/composer/magic_smileys");
+ MAIL_SCHEMA,
+ "composer-magic-smileys");
e_shell_settings_install_property_for_key (
"composer-outlook-filenames",
- "/apps/evolution/mail/composer/outlook_filenames");
+ MAIL_SCHEMA,
+ "composer-outlook-filenames");
e_shell_settings_install_property_for_key (
"composer-ignore-list-reply-to",
- "/apps/evolution/mail/composer/ignore_list_reply_to");
+ MAIL_SCHEMA,
+ "composer-ignore-list-reply-to");
e_shell_settings_install_property_for_key (
"composer-group-reply-to-list",
- "/apps/evolution/mail/composer/group_reply_to_list");
+ MAIL_SCHEMA,
+ "composer-group-reply-to-list");
e_shell_settings_install_property_for_key (
"composer-sign-reply-if-signed",
+ MAIL_SCHEMA,
"/apps/evolution/mail/composer/sign_reply_if_signed");
e_shell_settings_install_property_for_key (
"composer-prompt-only-bcc",
- "/apps/evolution/mail/prompts/only_bcc");
+ MAIL_SCHEMA,
+ "prompt-on-only-bcc");
e_shell_settings_install_property_for_key (
"composer-prompt-private-list-reply",
- "/apps/evolution/mail/prompts/private_list_reply");
+ MAIL_SCHEMA,
+ "prompt-on-private-list-reply");
e_shell_settings_install_property_for_key (
"composer-prompt-reply-many-recips",
- "/apps/evolution/mail/prompts/reply_many_recips");
+ MAIL_SCHEMA,
+ "prompt-on-reply-many-recips");
e_shell_settings_install_property_for_key (
"composer-prompt-list-reply-to",
- "/apps/evolution/mail/prompts/list_reply_to");
+ MAIL_SCHEMA,
+ "prompt-on-list-reply-to");
e_shell_settings_install_property_for_key (
"composer-prompt-empty-subject",
- "/apps/evolution/mail/prompts/empty_subject");
+ MAIL_SCHEMA,
+ "prompt-on-empty-subject");
e_shell_settings_install_property_for_key (
"composer-prompt-send-invalid-recip",
- "/apps/evolution/mail/prompts/send_invalid_recip");
+ MAIL_SCHEMA,
+ "prompt-on-invalid-recip");
e_shell_settings_install_property_for_key (
"composer-reply-start-bottom",
- "/apps/evolution/mail/composer/reply_start_bottom");
+ MAIL_SCHEMA,
+ "composer-reply-start-bottom");
e_shell_settings_install_property_for_key (
"composer-request-receipt",
- "/apps/evolution/mail/composer/request_receipt");
+ MAIL_SCHEMA,
+ "composer-request-receipt");
e_shell_settings_install_property_for_key (
"composer-spell-color",
- "/apps/evolution/mail/composer/spell_color");
+ MAIL_SCHEMA,
+ "composer-spell-color");
e_shell_settings_install_property_for_key (
"composer-top-signature",
- "/apps/evolution/mail/composer/top_signature");
+ MAIL_SCHEMA,
+ "composer-top-signature");
e_shell_settings_install_property_for_key (
"composer-no-signature-delim",
- "/apps/evolution/mail/composer/no_signature_delim");
+ MAIL_SCHEMA,
+ "composer-no-signature-delim");
e_shell_settings_install_property_for_key (
"composer-gallery-path",
- "/apps/evolution/mail/composer/gallery_path");
+ MAIL_SCHEMA,
+ "composer-gallery-path");
e_shell_settings_install_property_for_key (
"paned-view-headers-state",
- "/apps/evolution/mail/display/paned_view_headers_state");
+ MAIL_SCHEMA,
+ "paned-view-headers-state");
/* These properties use transform functions to convert
* GConf values to forms more useful to Evolution. We
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 82204ec85b..2427fc1ffd 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -378,7 +378,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
backend = E_MAIL_BACKEND (shell_backend);
session = e_mail_backend_get_session (backend);
cache = e_mail_session_get_folder_cache (session);
- key = "/apps/evolution/mail/prompts/mark_all_read";
+ key = "prompt-on-mark-all-read";
if (mail_folder_cache_get_folder_has_children (cache, folder, NULL))
prompt = "mail:ask-mark-all-read-sub";
@@ -1633,7 +1633,7 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view)
EMailView *mail_view;
GtkActionGroup *action_group;
GtkAction *action;
- GConfBridge *bridge;
+ GSettings *settings;
GObject *object;
const gchar *key;
@@ -1691,17 +1691,17 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view)
g_object_set (ACTION (MAIL_SEND_RECEIVE), "is-important", TRUE, NULL);
- /* Bind GObject properties for GConf keys. */
+ /* Bind GObject properties for GSettings keys. */
- bridge = gconf_bridge_get ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
object = G_OBJECT (ACTION (MAIL_SHOW_DELETED));
- key = "/apps/evolution/mail/display/show_deleted";
- gconf_bridge_bind_property (bridge, key, object, "active");
+ g_settings_bind (settings, "show-deleted", object, "active", G_SETTINGS_BIND_DEFAULT);
object = G_OBJECT (ACTION (MAIL_VIEW_VERTICAL));
- key = "/apps/evolution/mail/display/layout";
- gconf_bridge_bind_property (bridge, key, object, "current-value");
+ g_settings_bind (settings, "layout", object, "current-value", G_SETTINGS_BIND_DEFAULT);
+
+ g_object_unref (settings);
/* Fine tuning. */
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index 290e189e4b..da715f3a7d 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -33,8 +33,6 @@
#include <gtkhtml/gtkhtml-properties.h>
#include <libxml/tree.h>
-#include <gconf/gconf-client.h>
-
#include "libedataserverui/e-cell-renderer-color.h"
#include <e-util/e-util.h>
@@ -106,13 +104,7 @@ em_mailer_prefs_finalize (GObject *object)
g_object_unref (prefs->builder);
- if (prefs->labels_change_notify_id) {
- gconf_client_notify_remove (prefs->gconf, prefs->labels_change_notify_id);
-
- prefs->labels_change_notify_id = 0;
- }
-
- g_object_unref (prefs->gconf);
+ g_object_unref (prefs->settings);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (em_mailer_prefs_parent_class)->finalize (object);
@@ -130,7 +122,7 @@ em_mailer_prefs_class_init (EMMailerPrefsClass *class)
static void
em_mailer_prefs_init (EMMailerPrefs *preferences)
{
- preferences->gconf = gconf_client_get_default ();
+ preferences->settings = g_settings_new ("org.gnome.evolution.mail");
}
enum {
@@ -142,13 +134,16 @@ static void
jh_tree_refill (EMMailerPrefs *prefs)
{
GtkListStore *store = prefs->junk_header_list_store;
- GSList *l, *cjh = gconf_client_get_list (prefs->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, NULL);
+ gchar **strv;
+ gint ii;
+
+ strv = g_settings_get_strv (prefs->settings, "junk-custom-header");
gtk_list_store_clear (store);
- for (l = cjh; l; l = l->next) {
+ for (ii = 0; strv[ii] != NULL; ii++) {
GtkTreeIter iter;
- gchar **tokens = g_strsplit (l->data, "=", 2);
+ gchar **tokens = g_strsplit (strv[ii], "=", 2);
gtk_list_store_append (store, &iter);
gtk_list_store_set (
@@ -159,8 +154,7 @@ jh_tree_refill (EMMailerPrefs *prefs)
g_strfreev (tokens);
}
- g_slist_foreach (cjh, (GFunc) g_free, NULL);
- g_slist_free (cjh);
+ g_strfreev (strv);
}
static void
@@ -191,7 +185,6 @@ jh_add_cb (GtkWidget *widget,
GtkBuilder *builder = gtk_builder_new ();
gchar *tok;
const gchar *name, *value;
- GSList *list;
e_load_ui_builder_definition (builder, "mail-config.ui");
dialog = e_builder_get_widget (builder, "add-custom-junk-header");
@@ -205,16 +198,24 @@ jh_add_cb (GtkWidget *widget,
G_CALLBACK (jh_dialog_entry_changed_cb), builder);
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
+ gchar **strv;
+ GPtrArray *array;
+ gint ii;
+
name = gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (builder, "junk-header-name")));
value = gtk_entry_get_text (GTK_ENTRY (e_builder_get_widget (builder, "junk-header-content")));
- list = gconf_client_get_list (prefs->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, NULL);
+ strv = g_settings_get_strv (prefs->settings, "junk-custom-header");
+ array = g_ptr_array_new ();
+ for (ii = 0; strv[ii] != NULL; ii++)
+ g_ptr_array_add (array, strv[ii]);
tok = g_strdup_printf ("%s=%s", name, value);
- list = g_slist_append (list, tok);
- gconf_client_set_list (prefs->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, list, NULL);
+ g_ptr_array_add (array, tok);
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (prefs->settings, "junk-custom-header", (const gchar * const*) array->pdata);
- g_slist_foreach (list, (GFunc) g_free, NULL);
- g_slist_free (list);
+ g_ptr_array_free (array, TRUE);
+ g_strfreev (strv);
}
g_object_unref (builder);
@@ -236,39 +237,33 @@ jh_remove_cb (GtkWidget *widget,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (prefs->junk_header_tree));
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+ GPtrArray *array = g_ptr_array_new ();
gchar *name = NULL, *value = NULL;
- GSList *prev = NULL, *node, *list = gconf_client_get_list (prefs->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, NULL);
+ gchar **strv;
+ gint ii;
+
+ strv = g_settings_get_strv (prefs->settings, "junk-custom-header");
gtk_tree_model_get (model, &iter, JH_LIST_COLUMN_NAME, &name, JH_LIST_COLUMN_VALUE, &value, -1);
- node = list;
- while (node) {
+ for (ii = 0; strv[ii] != NULL; ii++) {
gchar *test;
gint len = strlen (name);
- test = strncmp (node->data, name, len) == 0 ? (gchar *) node->data + len : NULL;
+ test = strncmp (strv[ii], name, len) == 0 ? (gchar *) strv[ii] + len : NULL;
if (test) {
test++;
if (strcmp (test, value) == 0)
- break;
+ continue;
}
- prev = node;
- node = node->next;
+ g_ptr_array_add (array, strv[ii]);
}
- if (prev && !node) {
- /* Not found. So what? */
- } else if (prev && node) {
- prev->next = node->next;
- g_free (node->data);
- } else if (!prev && node) {
- list = list->next;
- g_free (node->data);
- }
+ g_ptr_array_add (array, NULL);
- gconf_client_set_list (prefs->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, list, NULL);
+ g_settings_set_strv (prefs->settings, "junk-custom-header", (const gchar * const*) array->pdata);
- g_slist_foreach (list, (GFunc) g_free, NULL);
- g_slist_free (list);
+ g_strfreev (strv);
+ g_ptr_array_free (array, TRUE);
g_free (name);
g_free (value);
@@ -494,7 +489,7 @@ toggle_button_toggled (GtkToggleButton *toggle,
const gchar *key;
key = g_object_get_data ((GObject *) toggle, "key");
- gconf_client_set_bool (prefs->gconf, key, gtk_toggle_button_get_active (toggle), NULL);
+ g_settings_set_boolean (prefs->settings, key, gtk_toggle_button_get_active (toggle));
}
static void
@@ -531,7 +526,7 @@ toggle_button_init (EMMailerPrefs *prefs,
{
gboolean bool;
- bool = gconf_client_get_bool (prefs->gconf, key, NULL);
+ bool = g_settings_get_boolean (prefs->settings, key);
gtk_toggle_button_set_active (toggle, not ? !bool : bool);
if (toggled) {
@@ -539,8 +534,8 @@ toggle_button_init (EMMailerPrefs *prefs,
g_signal_connect (toggle, "toggled", toggled, prefs);
}
- if (!gconf_client_key_is_writable (prefs->gconf, key, NULL))
- gtk_widget_set_sensitive ((GtkWidget *) toggle, FALSE);
+ if (!g_settings_is_writable (prefs->settings, key))
+ gtk_widget_set_sensitive (GTK_WIDGET (toggle), FALSE);
}
static void
@@ -553,10 +548,10 @@ trash_days_changed (GtkComboBox *combo_box,
g_return_if_fail (index >= 0);
g_return_if_fail (index < G_N_ELEMENTS (empty_trash_frequency));
- gconf_client_set_int (
- prefs->gconf,
- "/apps/evolution/mail/trash/empty_on_exit_days",
- empty_trash_frequency[index].days, NULL);
+ g_settings_set_int (
+ prefs->settings,
+ "trash-empty-on-exit-days",
+ empty_trash_frequency[index].days);
}
static void
@@ -567,9 +562,9 @@ emmp_empty_trash_init (EMMailerPrefs *prefs,
GtkListStore *store;
GtkTreeIter iter;
- days = gconf_client_get_int (
- prefs->gconf,
- "/apps/evolution/mail/trash/empty_on_exit_days", NULL);
+ days = g_settings_get_int (
+ prefs->settings,
+ "trash-empty-on-exit-days");
store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_box));
gtk_list_store_clear (store);
@@ -601,10 +596,10 @@ junk_days_changed (GtkComboBox *combo_box,
g_return_if_fail (index >= 0);
g_return_if_fail (index < G_N_ELEMENTS (empty_trash_frequency));
- gconf_client_set_int (
- prefs->gconf,
- "/apps/evolution/mail/junk/empty_on_exit_days",
- empty_trash_frequency[index].days, NULL);
+ g_settings_set_int (
+ prefs->settings,
+ "junk-empty-on-exit-days",
+ empty_trash_frequency[index].days);
}
static void
@@ -615,9 +610,9 @@ emmp_empty_junk_init (EMMailerPrefs *prefs,
GtkListStore *store;
GtkTreeIter iter;
- days = gconf_client_get_int (
- prefs->gconf,
- "/apps/evolution/mail/junk/empty_on_exit_days", NULL);
+ days = g_settings_get_int (
+ prefs->settings,
+ "junk-empty-on-exit-days");
store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_box));
gtk_list_store_clear (store);
@@ -652,7 +647,7 @@ http_images_changed (GtkWidget *widget,
else
policy = E_MAIL_IMAGE_LOADING_POLICY_NEVER;
- gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", policy, NULL);
+ g_settings_set_int (prefs->settings, "load-http-images", policy);
}
static GtkWidget *
@@ -870,9 +865,9 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
/* HTML Mail tab */
/* Loading Images */
- locked = !gconf_client_key_is_writable (prefs->gconf, "/apps/evolution/mail/display/load_http_images", NULL);
+ locked = !g_settings_is_writable (prefs->settings, "load-http-images");
- val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", NULL);
+ val = g_settings_get_int (prefs->settings, "load-http-images");
prefs->images_never = GTK_TOGGLE_BUTTON (e_builder_get_widget (prefs->builder, "radImagesNever"));
gtk_toggle_button_set_active (prefs->images_never, val == E_MAIL_IMAGE_LOADING_POLICY_NEVER);
if (locked)
diff --git a/modules/mail/em-mailer-prefs.h b/modules/mail/em-mailer-prefs.h
index 35ebec3bf7..b8e01b360d 100644
--- a/modules/mail/em-mailer-prefs.h
+++ b/modules/mail/em-mailer-prefs.h
@@ -24,7 +24,6 @@
#define EM_MAILER_PREFS_H
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
#include <shell/e-shell.h>
#include <widgets/misc/e-preferences-window.h>
@@ -57,6 +56,7 @@ struct _EMMailerPrefs {
GtkBuilder *builder;
GConfClient *gconf;
+ GSettings *settings;
/* General tab */
@@ -81,7 +81,6 @@ struct _EMMailerPrefs {
GtkWidget *label_remove;
GtkWidget *label_tree;
GtkListStore *label_list_store;
- guint labels_change_notify_id; /* mail_config's notify id */
/* Headers tab */
GtkButton *add_header;