aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-11-23 09:48:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-11-23 09:48:44 +0800
commit9918361aef9ad1360a0ed3a240cc58d6cd9e30f8 (patch)
tree50bf24934b5ab3fefcc27913d1855a27c75e6d40 /mail
parentfa1bb9a17e11cf12ce02d9b49bba2753f6020ea0 (diff)
parente64d6fe05c30c2cc1d7625a202afba3ba2da07cd (diff)
downloadgsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar
gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.gz
gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.bz2
gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.lz
gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.xz
gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.zst
gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.zip
Merge branch 'wip/gsettings'
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-attachment-bar.c15
-rw-r--r--mail/e-mail-browser.c11
-rw-r--r--mail/e-mail-label-list-store.c125
-rw-r--r--mail/e-mail-paned-view.c23
-rw-r--r--mail/e-mail-reader.c95
-rw-r--r--mail/e-mail-session.c98
-rw-r--r--mail/em-account-editor.c121
-rw-r--r--mail/em-composer-utils.c81
-rw-r--r--mail/em-config.c1
-rw-r--r--mail/em-folder-properties.c12
-rw-r--r--mail/em-subscription-editor.c45
-rw-r--r--mail/em-utils.c33
-rw-r--r--mail/mail-autoconfig/Makefile.am2
-rw-r--r--mail/mail-config.c200
-rw-r--r--mail/mail-config.ui1
-rw-r--r--mail/mail-vfolder.c12
-rw-r--r--mail/message-list.c70
17 files changed, 465 insertions, 480 deletions
diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c
index a48ca30f29..a33f8c98b8 100644
--- a/mail/e-mail-attachment-bar.c
+++ b/mail/e-mail-attachment-bar.c
@@ -27,8 +27,6 @@
#include <glib/gi18n.h>
-#include "e-util/gconf-bridge.h"
-
#include "e-attachment-store.h"
#include "e-attachment-icon-view.h"
#include "e-attachment-tree-view.h"
@@ -272,13 +270,10 @@ static void
mail_attachment_bar_constructed (GObject *object)
{
EMailAttachmentBarPrivate *priv;
- GConfBridge *bridge;
- const gchar *key;
+ GSettings *settings;
priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (object);
- bridge = gconf_bridge_get ();
-
/* Set up property-to-property bindings. */
g_object_bind_property (
@@ -329,10 +324,10 @@ mail_attachment_bar_constructed (GObject *object)
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
- /* Set up property-to-GConf bindings. */
-
- key = "/apps/evolution/shell/attachment_view";
- gconf_bridge_bind_property (bridge, key, object, "active-view");
+ /* Set up property-to-GSettings bindings. */
+ settings = g_settings_new ("org.gnome.evolution.shell");
+ g_settings_bind (settings, "attachment-view", object, "active-view", G_SETTINGS_BIND_DEFAULT);
+ g_object_unref (settings);
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_mail_attachment_bar_parent_class)->constructed (object);
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index e9c837206f..ec0e9251e0 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -542,7 +542,7 @@ mail_browser_constructed (GObject *object)
EShell *shell;
EFocusTracker *focus_tracker;
ESearchBar *search_bar;
- GConfBridge *bridge;
+ GSettings *settings;
GtkAccelGroup *accel_group;
GtkActionGroup *action_group;
GtkAction *action;
@@ -551,7 +551,6 @@ mail_browser_constructed (GObject *object)
GtkWidget *widget;
EWebView *web_view;
const gchar *domain;
- const gchar *key;
const gchar *id;
guint merge_id;
@@ -698,13 +697,13 @@ mail_browser_constructed (GObject *object)
G_CALLBACK (em_format_queue_redraw),
browser->priv->formatter);
- /* Bind GObject properties to GConf keys. */
+ /* Bind GObject properties to GSettings keys. */
- bridge = gconf_bridge_get ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
object = G_OBJECT (reader);
- key = "/apps/evolution/mail/display/show_deleted";
- gconf_bridge_bind_property (bridge, key, object, "show-deleted");
+ g_settings_bind (settings, "show-deleted", object, "show-deleted", G_SETTINGS_BIND_DEFAULT);
+ g_object_unref (settings);
id = "org.gnome.evolution.mail.browser";
e_plugin_ui_register_manager (ui_manager, id, object);
diff --git a/mail/e-mail-label-list-store.c b/mail/e-mail-label-list-store.c
index bcc915ccc4..bc9cb5ab3e 100644
--- a/mail/e-mail-label-list-store.c
+++ b/mail/e-mail-label-list-store.c
@@ -27,7 +27,6 @@
#include <glib/gi18n.h>
#include <camel/camel.h>
-#include "e-util/gconf-bridge.h"
#define E_MAIL_LABEL_LIST_STORE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -35,6 +34,7 @@
struct _EMailLabelListStorePrivate {
GHashTable *tag_index;
+ GSettings *mail_settings;
};
static struct {
@@ -167,6 +167,23 @@ mail_label_list_store_get_stock_id (EMailLabelListStore *store,
}
static void
+mail_label_list_store_dispose (GObject *object)
+{
+ EMailLabelListStorePrivate *priv;
+
+ priv = E_MAIL_LABEL_LIST_STORE_GET_PRIVATE (object);
+
+ if (priv->mail_settings != NULL) {
+ g_object_unref (priv->mail_settings);
+ priv->mail_settings = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (e_mail_label_list_store_parent_class)->
+ dispose (object);
+}
+
+static void
mail_label_list_store_finalize (GObject *object)
{
EMailLabelListStorePrivate *priv;
@@ -180,19 +197,104 @@ mail_label_list_store_finalize (GObject *object)
finalize (object);
}
+static void labels_settings_changed_cb (GSettings *settings, const gchar *key, gpointer user_data);
+
+static void
+labels_model_changed_cb (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data)
+{
+ EMailLabelListStore *store;
+ GPtrArray *array;
+ GtkTreeIter tmp_iter;
+ gboolean res;
+
+ store = E_MAIL_LABEL_LIST_STORE (user_data);
+
+ /* Make sure we don't enter an infinite synchronizing loop */
+ g_signal_handlers_block_by_func (store->priv->mail_settings, labels_settings_changed_cb, store);
+
+ /* Build list to store in GSettings */
+ array = g_ptr_array_new ();
+ res = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &tmp_iter);
+ while (res) {
+ gchar *string;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (store), &tmp_iter,
+ 0, &string, -1);
+ g_ptr_array_add (array, string);
+
+ res = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &tmp_iter);
+ }
+
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (
+ store->priv->mail_settings, "labels",
+ (const gchar * const *) array->pdata);
+
+ g_ptr_array_free (array, TRUE);
+ g_signal_handlers_unblock_by_func (store->priv->mail_settings, labels_settings_changed_cb, store);
+}
+
+static void
+labels_settings_changed_cb (GSettings *settings,
+ const gchar *key,
+ gpointer user_data)
+{
+ EMailLabelListStore *store;
+ gchar **strv;
+ gint i;
+
+ store = E_MAIL_LABEL_LIST_STORE (user_data);
+
+ /* Make sure we don't enter an infinite synchronizing loop */
+ g_signal_handlers_block_by_func (store, labels_model_changed_cb, store);
+
+ gtk_list_store_clear (GTK_LIST_STORE (store));
+
+ strv = g_settings_get_strv (store->priv->mail_settings, "labels");
+ for (i = 0; strv[i] != NULL; i++) {
+ GtkTreeIter iter;
+
+ gtk_list_store_insert_with_values (GTK_LIST_STORE (store),
+ &iter, -1,
+ 0, strv[i],
+ -1);
+ }
+
+ g_strfreev (strv);
+
+ g_signal_handlers_unblock_by_func (store, labels_model_changed_cb, store);
+}
+
static void
mail_label_list_store_constructed (GObject *object)
{
EMailLabelListStore *store;
- GConfBridge *bridge;
- const gchar *key;
store = E_MAIL_LABEL_LIST_STORE (object);
- bridge = gconf_bridge_get ();
- key = "/apps/evolution/mail/labels";
- gconf_bridge_bind_string_list_store (
- bridge, key, GTK_LIST_STORE (store));
+ /* Connect to GSettings' change notifications */
+ store->priv->mail_settings = g_settings_new ("org.gnome.evolution.mail");
+ g_signal_connect (
+ store->priv->mail_settings, "changed::labels",
+ G_CALLBACK (labels_settings_changed_cb), store);
+ labels_settings_changed_cb (store->priv->mail_settings, "labels", store);
+
+ /* Connect to ListStore change notifications */
+ g_signal_connect (
+ store, "row-inserted",
+ G_CALLBACK (labels_model_changed_cb), store);
+ g_signal_connect (
+ store, "row-changed",
+ G_CALLBACK (labels_model_changed_cb), store);
+ g_signal_connect (
+ store, "row-deleted",
+ G_CALLBACK (labels_model_changed_cb), store);
+ g_signal_connect (
+ store, "rows-reordered",
+ G_CALLBACK (labels_model_changed_cb), store);
mail_label_list_store_ensure_defaults (store);
@@ -235,6 +337,7 @@ e_mail_label_list_store_class_init (EMailLabelListStoreClass *class)
g_type_class_add_private (class, sizeof (EMailLabelListStorePrivate));
object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = mail_label_list_store_dispose;
object_class->finalize = mail_label_list_store_finalize;
object_class->constructed = mail_label_list_store_constructed;
@@ -264,10 +367,10 @@ e_mail_label_list_store_init (EMailLabelListStore *store)
/* XXX While it may seem awkward to cram the label name and color
* into a single string column, we do it for the benefit of
- * letting GConfBridge keep the model in sync with GConf.
+ * letting GSettings keep the model in sync.
*
* XXX There's a valid argument to be made that this information
- * doesn't belong in GConf in the first place. A key file
+ * doesn't belong in GSettings in the first place. A key file
* under $(user_data_dir)/mail would work better. */
gtk_list_store_set_column_types (GTK_LIST_STORE (store), 1, &type);
}
@@ -381,7 +484,7 @@ e_mail_label_list_store_get_tag (EMailLabelListStore *store,
strv = g_strsplit_set (encoded, ":|", 3);
/* XXX I guess for historical reasons the default label tags have
- * a "$Label" prefix, but the default list in GConf doesn't
+ * a "$Label" prefix, but the default list in GSettings doesn't
* include tags. That's why the <tag> part is optional.
* So if we're missing the <tag> part, look it up in the
* hard-coded default list above.
@@ -408,7 +511,7 @@ e_mail_label_list_store_get_tag (EMailLabelListStore *store,
}
}
- /* XXX Still no luck? The label list in GConf must be screwed up.
+ /* XXX Still no luck? The label list in GSettings must be screwed up.
* We must not return NULL because the tag is used as a key in
* the index hash table, so generate a tag from the name. */
if (result == NULL)
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index d1811394de..1634044589 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -30,7 +30,6 @@
#include <libedataserver/e-data-server-util.h>
#include "e-util/e-util-private.h"
-#include "e-util/gconf-bridge.h"
#include "widgets/menus/gal-view-etable.h"
#include "widgets/menus/gal-view-instance.h"
#include "widgets/misc/e-paned.h"
@@ -219,21 +218,23 @@ mail_paned_view_restore_state_cb (EShellWindow *shell_window,
EShellView *shell_view,
EMailPanedView *view)
{
- GConfBridge *bridge;
+ EMailPanedViewPrivate *priv;
+ GSettings *settings;
GObject *object;
- const gchar *key;
- /* Bind GObject properties to GConf keys. */
+ priv = E_MAIL_PANED_VIEW (view)->priv;
+
+ /* Bind GObject properties to GSettings keys. */
+
+ settings = g_settings_new ("org.gnome.evolution.mail");
- bridge = gconf_bridge_get ();
+ object = G_OBJECT (priv->paned);
+ g_settings_bind (settings, "hpaned-size", object, "hposition", G_SETTINGS_BIND_DEFAULT);
- object = G_OBJECT (view->priv->paned);
- key = "/apps/evolution/mail/display/hpaned_size";
- gconf_bridge_bind_property (bridge, key, object, "hposition");
+ object = G_OBJECT (priv->paned);
+ g_settings_bind (settings, "paned-size", object, "vposition", G_SETTINGS_BIND_DEFAULT);
- object = G_OBJECT (view->priv->paned);
- key = "/apps/evolution/mail/display/paned_size";
- gconf_bridge_bind_property (bridge, key, object, "vposition");
+ g_object_unref (settings);
}
static void
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 799ea1a92c..27af0d2b4b 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -36,7 +36,6 @@
#include "e-util/e-charset.h"
#include "e-util/e-util.h"
#include "e-util/e-alert-dialog.h"
-#include "e-util/gconf-bridge.h"
#include "shell/e-shell-utils.h"
#include "widgets/misc/e-popup-action.h"
#include "widgets/misc/e-menu-tool-action.h"
@@ -485,7 +484,7 @@ action_mail_flag_for_followup_cb (GtkAction *action,
static gboolean
get_close_browser_reader (EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
gchar *value;
gboolean close_it = FALSE;
@@ -494,10 +493,10 @@ get_close_browser_reader (EMailReader *reader)
if (!E_IS_MAIL_BROWSER (reader))
return FALSE;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- key = "/apps/evolution/mail/prompts/reply_close_browser";
- value = gconf_client_get_string (client, key, NULL);
+ key = "prompt-on-reply-close-browser";
+ value = g_settings_get_string (settings, key);
if (value && g_str_equal (value, "always")) {
close_it = TRUE;
@@ -526,13 +525,13 @@ get_close_browser_reader (EMailReader *reader)
close_it = response == GTK_RESPONSE_YES || response == GTK_RESPONSE_OK;
if (response == GTK_RESPONSE_OK)
- gconf_client_set_string (client, key, "always", NULL);
+ g_settings_set_string (settings, key, "always");
else if (response == GTK_RESPONSE_CANCEL)
- gconf_client_set_string (client, key, "never", NULL);
+ g_settings_set_string (settings, key, "never");
}
g_free (value);
- g_object_unref (client);
+ g_object_unref (settings);
return close_it;
}
@@ -1192,13 +1191,11 @@ action_mail_reply_all_check (CamelFolder *folder,
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) {
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/prompts/reply_many_recips";
- gconf_client_set_bool (client, key, FALSE, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ g_settings_set_boolean (settings, "prompt-on-reply-many-recips", FALSE);
+ g_object_unref (settings);
}
gtk_widget_destroy (dialog);
@@ -1228,17 +1225,17 @@ static void
action_mail_reply_all_cb (GtkAction *action,
EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
guint32 state;
gboolean ask;
state = e_mail_reader_check_state (reader);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/prompts/reply_many_recips";
- ask = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ key = "prompt-on-reply-many-recips";
+ ask = g_settings_get_boolean (settings, key);
+ g_object_unref (settings);
if (ask && !(state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
EActivity *activity;
@@ -1278,17 +1275,15 @@ static void
action_mail_reply_group_cb (GtkAction *action,
EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
gboolean reply_list;
- const gchar *key;
guint32 state;
state = e_mail_reader_check_state (reader);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/composer/group_reply_to_list";
- reply_list = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ reply_list = g_settings_get_boolean (settings, "composer-group-reply-to-list");
+ g_object_unref (settings);
if (reply_list && (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
e_mail_reader_reply_to_message (
@@ -1314,8 +1309,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
EAlertSink *alert_sink;
CamelMimeMessage *message;
EMailReplyType type = E_MAIL_REPLY_TO_SENDER;
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
gboolean ask_ignore_list_reply_to;
gboolean ask_list_reply_to;
gboolean munged_list_message;
@@ -1344,13 +1338,10 @@ action_mail_reply_sender_check (CamelFolder *folder,
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- key = "/apps/evolution/mail/composer/ignore_list_reply_to";
- ask_ignore_list_reply_to = gconf_client_get_bool (client, key, NULL);
-
- key = "/apps/evolution/mail/prompts/list_reply_to";
- ask_list_reply_to = gconf_client_get_bool (client, key, NULL);
+ ask_ignore_list_reply_to = g_settings_get_boolean (settings, "composer-ignore-list-reply-to");
+ ask_list_reply_to = g_settings_get_boolean (settings, "prompt-on-list-reply-to");
munged_list_message = em_utils_is_munged_list_message (message);
@@ -1382,8 +1373,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check));
if (active) {
- key = "/apps/evolution/mail/prompts/private_list_reply";
- gconf_client_set_bool (client, key, FALSE, NULL);
+ g_settings_set_boolean (settings, "prompt-on-private-list-reply", FALSE);
}
gtk_widget_destroy (dialog);
@@ -1429,14 +1419,12 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_again));
if (active) {
- key = "/apps/evolution/mail/prompts/list_reply_to";
- gconf_client_set_bool (client, key, FALSE, NULL);
+ g_settings_set_boolean (settings, "prompt-on-list-reply-to", FALSE);
}
- key = "/apps/evolution/mail/composer/ignore_list_reply_to";
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_always_ignore));
- gconf_client_set_bool (client, key, active, NULL);
+ g_settings_set_boolean (settings, "composer-ignore-list-reply-to", active);
gtk_widget_destroy (dialog);
@@ -1459,7 +1447,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
check_close_browser_reader (closure->reader);
exit:
- g_object_unref (client);
+ g_object_unref (settings);
g_object_unref (message);
mail_reader_closure_free (closure);
@@ -1469,21 +1457,18 @@ static void
action_mail_reply_sender_cb (GtkAction *action,
EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
gboolean ask_list_reply_to;
gboolean ask_private_list_reply;
gboolean ask;
- const gchar *key;
guint32 state;
state = e_mail_reader_check_state (reader);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/prompts/list_reply_to";
- ask_list_reply_to = gconf_client_get_bool (client, key, NULL);
- key = "/apps/evolution/mail/prompts/private_list_reply";
- ask_private_list_reply = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ ask_list_reply_to = g_settings_get_boolean (settings, "prompt-on-list-reply-to");
+ ask_private_list_reply = g_settings_get_boolean (settings, "prompt-on-private-list-reply");
+ g_object_unref (settings);
ask = (ask_private_list_reply || ask_list_reply_to);
@@ -3539,11 +3524,9 @@ e_mail_reader_init (EMailReader *reader,
EWebView *web_view;
GtkActionGroup *action_group;
GtkWidget *message_list;
- GConfBridge *bridge;
GtkAction *action;
gboolean sensitive;
const gchar *action_name;
- const gchar *key;
#ifndef G_OS_WIN32
GSettings *settings;
@@ -3624,19 +3607,19 @@ e_mail_reader_init (EMailReader *reader,
action_group, mail_reader_search_folder_entries,
G_N_ELEMENTS (mail_reader_search_folder_entries), reader);
- /* Bind GObject properties to GConf keys. */
+ /* Bind GObject properties to GSettings keys. */
- bridge = gconf_bridge_get ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
action_name = "mail-caret-mode";
- key = "/apps/evolution/mail/display/caret_mode";
action = e_mail_reader_get_action (reader, action_name);
- gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ g_settings_bind (settings, "caret-mode", G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT);
action_name = "mail-show-all-headers";
- key = "/apps/evolution/mail/display/show_all_headers";
action = e_mail_reader_get_action (reader, action_name);
- gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ g_settings_bind (settings, "show-all-headers", G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT);
+
+ g_object_unref (settings);
/* Fine tuning. */
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c
index 7e9508cf93..03f4961206 100644
--- a/mail/e-mail-session.c
+++ b/mail/e-mail-session.c
@@ -38,8 +38,6 @@
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-
#ifdef HAVE_CANBERRA
#include <canberra-gtk.h>
#endif
@@ -53,7 +51,6 @@
#include "e-util/e-account-utils.h"
#include "e-util/e-alert-dialog.h"
#include "e-util/e-util-private.h"
-#include "e-util/gconf-bridge.h"
#include "e-mail-folder-utils.h"
#include "e-mail-junk-filter.h"
@@ -73,8 +70,6 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_SESSION, EMailSessionPrivate))
-static guint session_check_junk_notify_id;
-
typedef struct _AsyncContext AsyncContext;
struct _EMailSessionPrivate {
@@ -320,14 +315,14 @@ main_get_filter_driver (CamelSession *session,
EFilterRule *rule = NULL;
const gchar *config_dir;
gchar *user, *system;
- GConfClient *client;
+ GSettings *settings;
ERuleContext *fc;
shell = e_shell_get_default ();
shell_backend = e_shell_get_backend_by_name (shell, "mail");
g_return_val_if_fail (E_IS_MAIL_BACKEND (shell_backend), NULL);
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
config_dir = mail_session_get_config_dir ();
user = g_build_filename (config_dir, "filters.xml", NULL);
@@ -341,12 +336,11 @@ main_get_filter_driver (CamelSession *session,
driver = camel_filter_driver_new (session);
camel_filter_driver_set_folder_func (driver, get_folder, session);
- if (gconf_client_get_bool (client, "/apps/evolution/mail/filters/log", NULL)) {
+ if (g_settings_get_boolean (settings, "filters-log-actions")) {
if (ms->priv->filter_logfile == NULL) {
gchar *filename;
- filename = gconf_client_get_string (
- client, "/apps/evolution/mail/filters/logfile", NULL);
+ filename = g_settings_get_string (settings, "filters-log-file");
if (filename) {
ms->priv->filter_logfile = g_fopen (filename, "a+");
g_free (filename);
@@ -403,7 +397,7 @@ main_get_filter_driver (CamelSession *session,
g_object_unref (fc);
- g_object_unref (client);
+ g_object_unref (settings);
return driver;
}
@@ -435,17 +429,17 @@ ms_forward_to_cb (CamelFolder *folder,
GAsyncResult *result,
EMailSession *session)
{
- GConfClient *client;
+ GSettings *settings;
/* FIXME Poor error handling. */
if (!e_mail_folder_append_message_finish (folder, result, NULL, NULL))
return;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
/* do not call mail send immediately, just pile them all in the outbox */
- if (preparing_flush || gconf_client_get_bool (
- client, "/apps/evolution/mail/filters/flush-outbox", NULL)) {
+ if (preparing_flush || g_settings_get_boolean (
+ settings, "flush-outbox")) {
if (preparing_flush)
g_source_remove (preparing_flush);
@@ -454,7 +448,7 @@ ms_forward_to_cb (CamelFolder *folder,
forward_to_flush_outbox_cb, session);
}
- g_object_unref (client);
+ g_object_unref (settings);
}
static void
@@ -488,24 +482,13 @@ mail_session_make_key (CamelService *service,
}
static void
-mail_session_check_junk_notify (GConfClient *gconf,
- guint id,
- GConfEntry *entry,
+mail_session_check_junk_notify (GSettings *settings,
+ const gchar *key,
CamelSession *session)
{
- gchar *key;
-
- g_return_if_fail (gconf_entry_get_key (entry) != NULL);
- g_return_if_fail (gconf_entry_get_value (entry) != NULL);
-
- key = strrchr (gconf_entry_get_key (entry), '/');
- if (key) {
- key++;
- if (strcmp (key, "check_incoming") == 0)
- camel_session_set_check_junk (
- session, gconf_value_get_bool (
- gconf_entry_get_value (entry)));
- }
+ if (strcmp (key, "junk-check-incoming") == 0)
+ camel_session_set_check_junk (
+ session, g_settings_get_boolean (settings, key));
}
static const gchar *
@@ -533,7 +516,7 @@ mail_session_get_junk_filter_name (EMailSession *session)
"unknown to Evolution of type %s",
G_OBJECT_TYPE_NAME (junk_filter));
- return ""; /* GConfBridge doesn't like NULL strings */
+ return "";
}
static void
@@ -560,7 +543,7 @@ mail_session_set_junk_filter_name (EMailSession *session,
} else {
g_warning (
"Unrecognized junk filter name "
- "'%s' in GConf", junk_filter_name);
+ "'%s' in GSettings", junk_filter_name);
}
}
@@ -631,22 +614,12 @@ static void
mail_session_finalize (GObject *object)
{
EMailSessionPrivate *priv;
- GConfClient *client;
priv = E_MAIL_SESSION_GET_PRIVATE (object);
g_hash_table_destroy (priv->junk_filters);
g_object_unref (priv->proxy);
- client = gconf_client_get_default ();
-
- if (session_check_junk_notify_id != 0) {
- gconf_client_notify_remove (client, session_check_junk_notify_id);
- session_check_junk_notify_id = 0;
- }
-
- g_object_unref (client);
-
g_free (mail_data_dir);
g_free (mail_config_dir);
@@ -673,6 +646,7 @@ mail_session_constructed (GObject *object)
EExtensible *extensible;
GType extension_type;
GList *list, *iter;
+ GSettings *settings;
priv = E_MAIL_SESSION_GET_PRIVATE (object);
@@ -726,13 +700,11 @@ mail_session_constructed (GObject *object)
g_list_free (list);
- /* Bind the "/apps/evolution/mail/junk/default_plugin"
- * GConf key to our "junk-filter-name" property. */
+ /* Bind the "junk-default-plugin" GSettings key to our "junk-filter-name" property. */
- gconf_bridge_bind_property (
- gconf_bridge_get (),
- "/apps/evolution/mail/junk/default_plugin",
- object, "junk-filter-name");
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ g_settings_bind (settings, "junk-default-plugin", object, "junk-filter-name", G_SETTINGS_BIND_DEFAULT);
+ g_object_unref (settings);
}
static CamelService *
@@ -1117,9 +1089,9 @@ mail_session_forward_to (CamelSession *session,
static void
mail_session_get_socks_proxy (CamelSession *session,
- const gchar *for_host,
- gchar **host_ret,
- gint *port_ret)
+ const gchar *for_host,
+ gchar **host_ret,
+ gint *port_ret)
{
EMailSession *mail_session;
gchar *uri;
@@ -1333,7 +1305,7 @@ e_mail_session_class_init (EMailSessionClass *class)
static void
e_mail_session_init (EMailSession *session)
{
- GConfClient *client;
+ GSettings *settings;
session->priv = E_MAIL_SESSION_GET_PRIVATE (session);
session->priv->folder_cache = mail_folder_cache_new ();
@@ -1344,24 +1316,20 @@ e_mail_session_init (EMailSession *session)
/* Initialize the EAccount setup. */
e_account_writable (NULL, E_ACCOUNT_SOURCE_SAVE_PASSWD);
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- gconf_client_add_dir (
- client, "/apps/evolution/mail/junk",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
camel_session_set_check_junk (
- CAMEL_SESSION (session), gconf_client_get_bool (
- client, "/apps/evolution/mail/junk/check_incoming", NULL));
- session_check_junk_notify_id = gconf_client_notify_add (
- client, "/apps/evolution/mail/junk",
- (GConfClientNotifyFunc) mail_session_check_junk_notify,
- session, NULL, NULL);
+ CAMEL_SESSION (session), g_settings_get_boolean (
+ settings, "junk-check-incoming"));
+ g_signal_connect (
+ settings, "changed",
+ G_CALLBACK (mail_session_check_junk_notify), session);
mail_config_reload_junk_headers (session);
e_proxy_setup_proxy (session->priv->proxy);
- g_object_unref (client);
+ g_object_unref (settings);
}
EMailSession *
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 45dd41fd9a..6bd96ef299 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -3786,8 +3786,12 @@ emae_defaults_page (EConfig *ec,
priv->trash_folder_button, "sensitive",
G_BINDING_SYNC_CREATE);
- pspec = !settings ? NULL : g_object_class_find_property (
- G_OBJECT_GET_CLASS (settings), "use-real-trash-path");
+ if (settings != NULL)
+ pspec = g_object_class_find_property (
+ G_OBJECT_GET_CLASS (settings),
+ "use-real-trash-path");
+ else
+ pspec = NULL;
if (pspec != NULL)
g_object_bind_property (
@@ -3796,12 +3800,20 @@ emae_defaults_page (EConfig *ec,
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
- pspec = !settings ? NULL : g_object_class_find_property (
- G_OBJECT_GET_CLASS (settings), "real-trash-path");
+ if (settings != NULL)
+ pspec = g_object_class_find_property (
+ G_OBJECT_GET_CLASS (settings),
+ "real-trash-path");
+ else
+ pspec = NULL;
if (pspec != NULL) {
- set_real_folder_path (priv->trash_folder_button, settings, "real-trash-path", account);
- g_signal_connect (priv->trash_folder_button, "notify::folder-uri", G_CALLBACK (update_real_folder_cb), emae);
+ set_real_folder_path (
+ priv->trash_folder_button,
+ settings, "real-trash-path", account);
+ g_signal_connect (
+ priv->trash_folder_button, "notify::folder-uri",
+ G_CALLBACK (update_real_folder_cb), emae);
}
flags = CAMEL_PROVIDER_ALLOW_REAL_TRASH_FOLDER;
@@ -3832,8 +3844,12 @@ emae_defaults_page (EConfig *ec,
priv->junk_folder_button, "sensitive",
G_BINDING_SYNC_CREATE);
- pspec = !settings ? NULL : g_object_class_find_property (
- G_OBJECT_GET_CLASS (settings), "use-real-junk-path");
+ if (settings != NULL)
+ pspec = g_object_class_find_property (
+ G_OBJECT_GET_CLASS (settings),
+ "use-real-junk-path");
+ else
+ pspec = NULL;
if (pspec != NULL)
g_object_bind_property (
@@ -3842,12 +3858,20 @@ emae_defaults_page (EConfig *ec,
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
- pspec = !settings ? NULL : g_object_class_find_property (
- G_OBJECT_GET_CLASS (settings), "real-junk-path");
+ if (settings != NULL)
+ pspec = g_object_class_find_property (
+ G_OBJECT_GET_CLASS (settings),
+ "real-junk-path");
+ else
+ pspec = NULL;
if (pspec != NULL) {
- set_real_folder_path (priv->junk_folder_button, settings, "real-junk-path", account);
- g_signal_connect (priv->junk_folder_button, "notify::folder-uri", G_CALLBACK (update_real_folder_cb), emae);
+ set_real_folder_path (
+ priv->junk_folder_button,
+ settings, "real-junk-path", account);
+ g_signal_connect (
+ priv->junk_folder_button, "notify::folder-uri",
+ G_CALLBACK (update_real_folder_cb), emae);
}
flags = CAMEL_PROVIDER_ALLOW_REAL_JUNK_FOLDER;
@@ -3861,7 +3885,9 @@ emae_defaults_page (EConfig *ec,
/* Special Folders "Reset Defaults" button */
priv->restore_folders_button = (GtkButton *)e_builder_get_widget (builder, "default_folders_button");
- g_signal_connect (priv->restore_folders_button, "clicked", G_CALLBACK (default_folders_clicked), emae);
+ g_signal_connect (
+ priv->restore_folders_button, "clicked",
+ G_CALLBACK (default_folders_clicked), emae);
/* Always Cc/Bcc */
emae_account_toggle (emae, "always_cc", E_ACCOUNT_CC_ALWAYS, builder);
@@ -3869,12 +3895,13 @@ emae_defaults_page (EConfig *ec,
emae_account_toggle (emae, "always_bcc", E_ACCOUNT_BCC_ALWAYS, builder);
emae_account_entry (emae, "bcc_addrs", E_ACCOUNT_BCC_ADDRS, builder);
- gtk_widget_set_sensitive ( (GtkWidget *) priv->sent_folder_button,
- (provider ? !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER): TRUE)
- );
+ gtk_widget_set_sensitive (
+ GTK_WIDGET (priv->sent_folder_button),
+ (provider ? !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER) : TRUE));
- gtk_widget_set_sensitive ((GtkWidget *) priv->restore_folders_button,
- (provider && !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)));
+ gtk_widget_set_sensitive (
+ GTK_WIDGET (priv->restore_folders_button),
+ (provider && !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)));
/* Receipt policy */
emae_setup_receipt_policy (emae, builder);
@@ -4809,7 +4836,7 @@ forget_password_if_needed (EAccount *original_account,
#define CALENDAR_CALDAV_URI "caldav://%s@www.google.com/calendar/dav/%s/events"
#define GMAIL_CALENDAR_LOCATION "://www.google.com/calendar/feeds/"
#define CALENDAR_DEFAULT_PATH "/private/full"
-#define SELECTED_CALENDARS "/apps/evolution/calendar/display/selected_calendars"
+#define SELECTED_CALENDARS "selected-calendars"
#define YAHOO_CALENDAR_LOCATION "%s@caldav.calendar.yahoo.com/dav/%s/Calendar/%s"
static gchar *
@@ -4896,8 +4923,11 @@ setup_google_calendar (EMAccountEditor *emae)
ESource *calendar;
gchar *sanitize_uname, *username;
gchar *abs_uri, *rel_uri;
- GSList *ids, *temp;
+ gchar **ids;
+ gint i;
+ GPtrArray *array;
CamelURL *url;
+ GSettings *settings;
gconf = gconf_client_get_default ();
slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources");
@@ -4929,16 +4959,21 @@ setup_google_calendar (EMAccountEditor *emae)
e_source_list_sync (slist, NULL);
- ids = gconf_client_get_list (gconf, SELECTED_CALENDARS, GCONF_VALUE_STRING, NULL);
- ids = g_slist_append (ids, g_strdup (e_source_peek_uid (calendar)));
- gconf_client_set_list (gconf, SELECTED_CALENDARS, GCONF_VALUE_STRING, ids, NULL);
- temp = ids;
-
- for (; temp != NULL; temp = g_slist_next (temp))
- g_free (temp->data);
-
+ settings = g_settings_new ("org.gnome.evolution.calendar");
+ ids = g_settings_get_strv (settings, SELECTED_CALENDARS);
+ array = g_ptr_array_new ();
+ for (i = 0; ids[i] != NULL; i++)
+ g_ptr_array_add (array, ids[i]);
+ g_ptr_array_add (array, (gpointer) e_source_peek_uid (calendar));
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (
+ settings, SELECTED_CALENDARS,
+ (const gchar * const *) array->pdata);
+
+ g_strfreev (ids);
+ g_ptr_array_free (array, TRUE);
+ g_object_unref (settings);
g_free (username);
- g_slist_free (ids);
g_free (abs_uri);
g_free (rel_uri);
g_free (sanitize_uname);
@@ -4957,8 +4992,11 @@ setup_yahoo_calendar (EMAccountEditor *emae)
ESource *calendar;
gchar *sanitize_uname;
gchar *abs_uri, *rel_uri;
- GSList *ids, *temp;
const gchar *email;
+ GSettings *settings;
+ gchar **ids;
+ gint i;
+ GPtrArray *array;
gconf = gconf_client_get_default ();
email = e_account_get_string (em_account_editor_get_modified_account (emae), E_ACCOUNT_ID_ADDRESS);
@@ -4993,15 +5031,20 @@ setup_yahoo_calendar (EMAccountEditor *emae)
e_source_group_add_source (sgrp, calendar, -1);
e_source_list_sync (slist, NULL);
- ids = gconf_client_get_list (gconf, SELECTED_CALENDARS, GCONF_VALUE_STRING, NULL);
- ids = g_slist_append (ids, g_strdup (e_source_peek_uid (calendar)));
- gconf_client_set_list (gconf, SELECTED_CALENDARS, GCONF_VALUE_STRING, ids, NULL);
- temp = ids;
-
- for (; temp != NULL; temp = g_slist_next (temp))
- g_free (temp->data);
-
- g_slist_free (ids);
+ settings = g_settings_new ("org.gnome.evolution.calendar");
+ ids = g_settings_get_strv (settings, SELECTED_CALENDARS);
+ array = g_ptr_array_new ();
+ for (i = 0; ids[i] != NULL; i++)
+ g_ptr_array_add (array, ids[i]);
+ g_ptr_array_add (array, (gpointer) e_source_peek_uid (calendar));
+ g_ptr_array_add (array, NULL);
+ g_settings_set_strv (
+ settings, SELECTED_CALENDARS,
+ (const gchar * const *) array->pdata);
+
+ g_strfreev (ids);
+ g_ptr_array_free (array, TRUE);
+ g_object_unref (settings);
g_free (abs_uri);
g_free (rel_uri);
g_free (sanitize_uname);
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index bc84e5508c..0eceeea228 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -69,9 +69,6 @@
#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
#endif
-#define GCONF_KEY_TEMPLATE_PLACEHOLDERS \
- "/apps/evolution/mail/template_placeholders"
-
typedef struct _AsyncContext AsyncContext;
typedef struct _ForwardData ForwardData;
@@ -159,7 +156,7 @@ ask_confirm_for_unwanted_html_mail (EMsgComposer *composer,
if (str->len)
res = em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/unwanted_html",
+ "prompt-on-unwanted-html",
"mail:ask-send-html", str->str, NULL);
else
res = TRUE;
@@ -174,7 +171,7 @@ ask_confirm_for_empty_subject (EMsgComposer *composer)
{
return em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/empty_subject",
+ "prompt-on-empty-subject",
"mail:ask-send-no-subject", NULL);
}
@@ -190,7 +187,7 @@ ask_confirm_for_only_bcc (EMsgComposer *composer,
return em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/only_bcc",
+ "prompt-on-only-bcc",
hidden_list_case ?
"mail:ask-send-only-bcc-contact" :
"mail:ask-send-only-bcc", NULL);
@@ -333,7 +330,7 @@ composer_presend_check_recipients (EMsgComposer *composer)
if (invalid_addrs) {
if (!em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/send_invalid_recip",
+ "prompt-on-invalid-recip",
strstr (invalid_addrs->str, ", ") ?
"mail:ask-send-invalid-recip-multi" :
"mail:ask-send-invalid-recip-one",
@@ -453,23 +450,21 @@ composer_presend_check_unwanted_html (EMsgComposer *composer)
{
EDestination **recipients;
EComposerHeaderTable *table;
- GConfClient *client;
+ GSettings *settings;
gboolean check_passed = TRUE;
gboolean html_mode;
gboolean send_html;
gboolean confirm_html;
gint ii;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
table = e_msg_composer_get_header_table (composer);
recipients = e_composer_header_table_get_destinations (table);
html_mode = gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer));
- send_html = gconf_client_get_bool (
- client, "/apps/evolution/mail/composer/send_html", NULL);
- confirm_html = gconf_client_get_bool (
- client, "/apps/evolution/mail/prompts/unwanted_html", NULL);
+ send_html = g_settings_get_boolean (settings, "composer-send-html");
+ confirm_html = g_settings_get_boolean (settings, "prompt-on-unwanted-html");
/* Only show this warning if our default is to send html. If it
* isn't, we've manually switched into html mode in the composer
@@ -493,7 +488,7 @@ composer_presend_check_unwanted_html (EMsgComposer *composer)
if (recipients != NULL)
e_destination_freev (recipients);
- g_object_unref (client);
+ g_object_unref (settings);
return check_passed;
}
@@ -1189,11 +1184,11 @@ typedef enum {
} QuotingTextEnum;
static struct {
- const gchar * gconf_key;
+ const gchar * conf_key;
const gchar * message;
} conf_messages[] = {
[QUOTING_ATTRIBUTION] =
- { "/apps/evolution/mail/composer/message_attribution",
+ { "composer-message-attribution",
/* Note to translators: this is the attribution string used
* when quoting messages. Each ${Variable} gets replaced
* with a value. To see a full list of available variables,
@@ -1203,12 +1198,12 @@ static struct {
},
[QUOTING_FORWARD] =
- { "/apps/evolution/mail/composer/message_forward",
+ { "composer-message-forward",
N_("-------- Forwarded Message --------")
},
[QUOTING_ORIGINAL] =
- { "/apps/evolution/mail/composer/message_original",
+ { "composer-message-original",
N_("-----Original Message-----")
}
};
@@ -1216,12 +1211,12 @@ static struct {
static gchar *
quoting_text (QuotingTextEnum type)
{
- GConfClient *client;
+ GSettings *settings;
gchar *text;
- client = gconf_client_get_default ();
- text = gconf_client_get_string (client, conf_messages[type].gconf_key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ text = g_settings_get_string (settings, conf_messages[type].conf_key);
+ g_object_unref (settings);
if (text && *text)
return text;
@@ -1263,15 +1258,19 @@ em_utils_edit_message (EShell *shell,
/* Template specific code follows. */
if (folder_is_templates) {
CamelDataWrapper *content;
- GConfClient *gconf;
+ GSettings *settings;
+ gchar **strv;
+ gint i;
GSList *clue_list = NULL;
- gconf = gconf_client_get_default ();
- /* Get the list from gconf */
- clue_list = gconf_client_get_list (
- gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS,
- GCONF_VALUE_STRING, NULL );
- g_object_unref (gconf);
+ settings = g_settings_new ("org.gnome.evolution.plugin.templates");
+
+ /* Get the list from GSettings */
+ strv = g_settings_get_strv (settings, "template-placeholders");
+ for (i = 0; strv[i] != NULL; i++)
+ clue_list = g_slist_append (clue_list, g_strdup (strv[i]));
+ g_object_unref (settings);
+ g_strfreev (strv);
content = camel_medium_get_content (CAMEL_MEDIUM (message));
traverse_parts (clue_list, message, content);
@@ -2085,14 +2084,12 @@ get_reply_to (CamelMimeMessage *message)
reply_to = camel_mime_message_get_reply_to (message);
if (reply_to) {
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
gboolean ignore_list_reply_to;
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/composer/ignore_list_reply_to";
- ignore_list_reply_to = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ ignore_list_reply_to = g_settings_get_boolean (settings, "composer-ignore-list-reply-to");
+ g_object_unref (settings);
if (ignore_list_reply_to && em_utils_is_munged_list_message (message))
reply_to = NULL;
@@ -2529,15 +2526,13 @@ composer_set_body (EMsgComposer *composer,
{
gchar *text, *credits, *original;
CamelMimePart *part;
- GConfClient *client;
+ GSettings *settings;
gboolean start_bottom, has_body_text = FALSE;
guint32 validity_found = 0;
- const gchar *key;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- key = "/apps/evolution/mail/composer/reply_start_bottom";
- start_bottom = gconf_client_get_bool (client, key, NULL);
+ start_bottom = g_settings_get_boolean (settings, "composer-reply-start-bottom");
switch (style) {
case E_MAIL_REPLY_STYLE_DO_NOT_QUOTE:
@@ -2580,7 +2575,6 @@ composer_set_body (EMsgComposer *composer,
GtkhtmlEditor *editor = GTKHTML_EDITOR (composer);
gboolean move_cursor_to_end;
gboolean top_signature;
- const gchar *key;
/* If we are placing signature on top, then move cursor to the end,
* otherwise try to find the signature place and place cursor just
@@ -2588,8 +2582,7 @@ composer_set_body (EMsgComposer *composer,
gtkhtml_editor_run_command (editor, "block-selection");
gtkhtml_editor_run_command (editor, "cursor-bod");
- key = "/apps/evolution/mail/composer/top_signature";
- top_signature = gconf_client_get_bool (client, key, NULL);
+ top_signature = g_settings_get_boolean (settings, "composer-top-signature");
move_cursor_to_end = top_signature ||
!gtkhtml_editor_search_by_data (
@@ -2602,7 +2595,7 @@ composer_set_body (EMsgComposer *composer,
gtkhtml_editor_run_command (editor, "unblock-selection");
}
- g_object_unref (client);
+ g_object_unref (settings);
}
gchar *
diff --git a/mail/em-config.c b/mail/em-config.c
index 6a133f1c56..352e16b4b1 100644
--- a/mail/em-config.c
+++ b/mail/em-config.c
@@ -121,7 +121,6 @@ em_config_class_init (EMConfigClass *class)
{
EConfigClass *config_class;
-
config_class = E_CONFIG_CLASS (class);
config_class->set_target = em_config_set_target;
config_class->target_free = em_config_target_free;
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index 6e8e04c26f..310aa76740 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -29,8 +29,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <gconf/gconf-client.h>
-
#include "em-folder-properties.h"
#include "em-config.h"
@@ -254,9 +252,8 @@ emfp_dialog_run (AsyncContext *context)
CamelStore *local_store;
CamelStore *parent_store;
gboolean hide_deleted;
- GConfClient *client;
+ GSettings *settings;
const gchar *name;
- const gchar *key;
shell_view = context->shell_view;
shell_window = e_shell_view_get_shell_window (shell_view);
@@ -272,10 +269,9 @@ emfp_dialog_run (AsyncContext *context)
context->unread = camel_folder_summary_get_unread_count (context->folder->summary);
deleted = camel_folder_summary_get_deleted_count (context->folder->summary);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/display/show_deleted";
- hide_deleted = !gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ hide_deleted = !g_settings_get_boolean (settings, "show-deleted");
+ g_object_unref (settings);
/*
* Do the calculation only for those accounts that support VTRASHes
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index d92713f8be..1d201f5d40 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -374,10 +374,9 @@ subscription_editor_subscribe_folder_done (CamelSubscribable *subscribable,
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
}
-
static void
subscription_editor_subscribe_many (EMSubscriptionEditor *editor,
- GSList *async_datas)
+ GSList *async_datas)
{
AsyncData *async_data;
AsyncContext *context;
@@ -499,10 +498,9 @@ subscription_editor_unsubscribe_folder_done (CamelSubscribable *subscribable,
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
}
-
static void
subscription_editor_unsubscribe_many (EMSubscriptionEditor *editor,
- GSList *async_datas)
+ GSList *async_datas)
{
AsyncData *async_data;
AsyncContext *context;
@@ -552,9 +550,9 @@ subscription_editor_unsubscribe_many (EMSubscriptionEditor *editor,
static GtkWidget *
subscription_editor_create_menu_item (const gchar *label,
- gboolean sensitive,
- GCallback activate_cb,
- EMSubscriptionEditor *editor)
+ gboolean sensitive,
+ GCallback activate_cb,
+ EMSubscriptionEditor *editor)
{
GtkWidget *item;
@@ -570,10 +568,10 @@ subscription_editor_create_menu_item (const gchar *label,
static void
position_below_widget_cb (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer under_widget)
+ gint *x,
+ gint *y,
+ gboolean *push_in,
+ gpointer under_widget)
{
GtkRequisition menu_requisition;
GtkTextDirection direction;
@@ -611,9 +609,9 @@ position_below_widget_cb (GtkMenu *menu,
static AsyncData *
subscription_editor_async_data_from_iter (GtkTreeView *tree_view,
- GtkTreeModel *model,
- GtkTreeIter *iter,
- gboolean *is_expanded)
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gboolean *is_expanded)
{
AsyncData *data;
CamelFolderInfo *folder_info = NULL;
@@ -650,7 +648,8 @@ typedef enum {
} EPickMode;
static gboolean
-can_pick_folder_info (CamelFolderInfo *fi, EPickMode mode)
+can_pick_folder_info (CamelFolderInfo *fi,
+ EPickMode mode)
{
if (!FOLDER_CAN_SELECT (fi))
return FALSE;
@@ -670,9 +669,9 @@ struct PickAllData {
static gboolean
pick_all_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data)
{
struct PickAllData *data = user_data;
AsyncData *async_data;
@@ -696,13 +695,13 @@ pick_all_cb (GtkTreeModel *model,
}
/* skip_folder_infos contains CamelFolderInfo-s to skip;
- these should come from the tree view; can be NULL
- to include everything.
+ * these should come from the tree view; can be NULL
+ * to include everything.
*/
static GSList *
subscription_editor_pick_all (EMSubscriptionEditor *editor,
- EPickMode mode,
- GHashTable *skip_folder_infos)
+ EPickMode mode,
+ GHashTable *skip_folder_infos)
{
GtkTreeView *tree_view;
GtkTreeModel *tree_model;
@@ -723,7 +722,7 @@ subscription_editor_pick_all (EMSubscriptionEditor *editor,
static GSList *
subscription_editor_pick_shown (EMSubscriptionEditor *editor,
- EPickMode mode)
+ EPickMode mode)
{
GtkTreeView *tree_view;
GtkTreeModel *tree_model;
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 1423130772..c15f8b67b5 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -105,7 +105,7 @@ em_utils_ask_open_many (GtkWindow *parent,
"Are you sure you want to open %d messages at once?",
how_many), how_many);
proceed = em_utils_prompt_user (
- parent, "/apps/evolution/mail/prompts/open_many",
+ parent, "prompt-on-open-many",
"mail:ask-open-many", string, NULL);
g_free (string);
@@ -115,7 +115,7 @@ em_utils_ask_open_many (GtkWindow *parent,
/**
* em_utils_prompt_user:
* @parent: parent window
- * @promptkey: gconf key to check if we should prompt the user or not.
+ * @promptkey: settings key to check if we should prompt the user or not.
* @tag: e_alert tag.
*
* Convenience function to query the user with a Yes/No dialog and a
@@ -136,13 +136,13 @@ em_utils_prompt_user (GtkWindow *parent,
GtkWidget *container;
va_list ap;
gint button;
- GConfClient *client;
+ GSettings *settings;
EAlert *alert = NULL;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- if (promptkey && !gconf_client_get_bool (client, promptkey, NULL)) {
- g_object_unref (client);
+ if (promptkey && !g_settings_get_boolean (settings, promptkey)) {
+ g_object_unref (settings);
return TRUE;
}
@@ -165,14 +165,14 @@ em_utils_prompt_user (GtkWindow *parent,
button = gtk_dialog_run (GTK_DIALOG (dialog));
if (promptkey)
- gconf_client_set_bool (
- client, promptkey,
+ g_settings_set_boolean (
+ settings, promptkey,
!gtk_toggle_button_get_active (
- GTK_TOGGLE_BUTTON (check)), NULL);
+ GTK_TOGGLE_BUTTON (check)));
gtk_widget_destroy (dialog);
- g_object_unref (client);
+ g_object_unref (settings);
return button == GTK_RESPONSE_YES;
}
@@ -1229,16 +1229,15 @@ em_utils_message_to_html (CamelMimeMessage *message,
((EMFormat *) emfq)->composer = TRUE;
if (!source) {
- GConfClient *gconf;
+ GSettings *settings;
gchar *charset;
/* FIXME We should be getting this from the
* current view, not the global setting. */
- gconf = gconf_client_get_default ();
- charset = gconf_client_get_string (
- gconf, "/apps/evolution/mail/display/charset", NULL);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ charset = g_settings_get_string (settings, "charset");
em_format_set_default_charset ((EMFormat *) emfq, charset);
- g_object_unref (gconf);
+ g_object_unref (settings);
g_free (charset);
}
@@ -1279,7 +1278,7 @@ em_utils_expunge_folder (GtkWidget *parent,
if (!em_utils_prompt_user (
GTK_WINDOW (parent),
- "/apps/evolution/mail/prompts/expunge",
+ "prompt-on-expunge",
"mail:ask-expunge", description, NULL))
return;
@@ -1303,7 +1302,7 @@ em_utils_empty_trash (GtkWidget *parent,
g_return_if_fail (E_IS_MAIL_BACKEND (backend));
if (!em_utils_prompt_user ((GtkWindow *) parent,
- "/apps/evolution/mail/prompts/empty_trash",
+ "prompt-on-empty-trash",
"mail:ask-empty-trash", NULL))
return;
diff --git a/mail/mail-autoconfig/Makefile.am b/mail/mail-autoconfig/Makefile.am
index 451101d364..fffd222751 100644
--- a/mail/mail-autoconfig/Makefile.am
+++ b/mail/mail-autoconfig/Makefile.am
@@ -184,3 +184,5 @@ autoconfigdir = $(privdatadir)/mail-autoconfig
EXTRA_DIST = \
$(autoconfig_DATA) \
README
+
+-include $(top_srcdir)/git.mk
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 7356772e99..bbad256d2f 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -34,8 +34,6 @@
#include "e-util/e-account-utils.h"
#include "e-util/e-signature-utils.h"
-#include <gconf/gconf-client.h>
-
#include "e-mail-local.h"
#include "e-mail-folder-utils.h"
#include "mail-config.h"
@@ -56,41 +54,38 @@ typedef struct {
extern gint camel_header_param_encode_filenames_in_rfc_2047;
static MailConfig *config = NULL;
+static GSettings *mail_settings = NULL;
static void
-gconf_outlook_filenames_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
+settings_outlook_filenames_changed (GSettings *settings,
+ const gchar *key,
+ gpointer user_data)
{
- const gchar *key;
-
- g_return_if_fail (client != NULL);
-
- key = "/apps/evolution/mail/composer/outlook_filenames";
-
/* pass option to the camel */
- if (gconf_client_get_bool (client, key, NULL))
+ if (g_settings_get_boolean (settings, key))
camel_header_param_encode_filenames_in_rfc_2047 = 1;
else
camel_header_param_encode_filenames_in_rfc_2047 = 0;
}
static void
-gconf_jh_headers_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- EMailSession *session)
+settings_jh_headers_changed (GSettings *settings,
+ const gchar *key,
+ EMailSession *session)
{
GSList *node;
GPtrArray *name, *value;
+ gchar **strv;
+ gint i;
g_slist_foreach (config->jh_header, (GFunc) g_free, NULL);
g_slist_free (config->jh_header);
+ config->jh_header = NULL;
- config->jh_header = gconf_client_get_list (
- client, "/apps/evolution/mail/junk/custom_header",
- GCONF_VALUE_STRING, NULL);
+ strv = g_settings_get_strv (settings, "junk-custom-header");
+ for (i = 0; strv[i] != NULL; i++)
+ config->jh_header = g_slist_append (config->jh_header, g_strdup (strv[i]));
+ g_strfreev (strv);
node = config->jh_header;
name = g_ptr_array_new ();
@@ -114,55 +109,38 @@ gconf_jh_headers_changed (GConfClient *client,
}
static void
-gconf_jh_check_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- EMailSession *session)
+settings_jh_check_changed (GSettings *settings,
+ const gchar *key,
+ EMailSession *session)
{
- config->jh_check = gconf_client_get_bool (
- client, "/apps/evolution/mail/junk/check_custom_header", NULL);
+ config->jh_check = g_settings_get_boolean (settings, "junk-check-custom-header");
if (!config->jh_check) {
camel_session_set_junk_headers (
CAMEL_SESSION (session), NULL, NULL, 0);
} else {
- gconf_jh_headers_changed (client, 0, NULL, session);
+ settings_jh_headers_changed (settings, NULL, session);
}
}
static void
-gconf_bool_value_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gboolean *save_location)
+settings_bool_value_changed (GSettings *settings,
+ const gchar *key,
+ gboolean *save_location)
{
- GError *error = NULL;
-
- *save_location = gconf_client_get_bool (client, entry->key, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
+ *save_location = g_settings_get_boolean (settings, key);
}
static void
-gconf_int_value_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gint *save_location)
+settings_int_value_changed (GSettings *settings,
+ const gchar *key,
+ gint *save_location)
{
- GError *error = NULL;
-
- *save_location = gconf_client_get_int (client, entry->key, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
+ *save_location = g_settings_get_int (settings, key);
}
void
mail_config_write (void)
{
- GConfClient *client;
EAccountList *account_list;
ESignatureList *signature_list;
@@ -175,9 +153,7 @@ mail_config_write (void)
e_account_list_save (account_list);
e_signature_list_save (signature_list);
- client = gconf_client_get_default ();
- gconf_client_suggest_sync (client, NULL);
- g_object_unref (client);
+ g_settings_sync ();
}
gint
@@ -193,24 +169,16 @@ mail_config_get_address_count (void)
gint
mail_config_get_sync_timeout (void)
{
- GConfClient *client;
gint res = 60;
- GError *error = NULL;
-
- client = gconf_client_get_default ();
- res = gconf_client_get_int (
- client, "/apps/evolution/mail/sync_interval", &error);
+ res = g_settings_get_int (mail_settings, "sync-interval");
/* do not allow recheck sooner than every 30 seconds */
- if (error || res == 0)
+ if (res == 0)
res = 60;
else if (res < 30)
res = 30;
- if (error)
- g_error_free (error);
-
return res;
}
@@ -249,11 +217,7 @@ mail_config_reload_junk_headers (EMailSession *session)
if (config == NULL)
mail_config_init (session);
else {
- GConfClient *client;
-
- client = gconf_client_get_default ();
- gconf_jh_check_changed (client, 0, NULL, session);
- g_object_unref (client);
+ settings_jh_check_changed (mail_settings, NULL, session);
}
}
@@ -277,10 +241,6 @@ mail_config_get_lookup_book_local_only (void)
void
mail_config_init (EMailSession *session)
{
- GConfClient *client;
- GConfClientNotifyFunc func;
- const gchar *key;
-
g_return_if_fail (E_IS_MAIL_SESSION (session));
if (config)
@@ -288,80 +248,48 @@ mail_config_init (EMailSession *session)
config = g_new0 (MailConfig, 1);
- client = gconf_client_get_default ();
-
- gconf_client_add_dir (
- client, "/apps/evolution/mail/prompts",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ mail_settings = g_settings_new ("org.gnome.evolution.mail");
/* Composer Configuration */
- gconf_client_add_dir (
- client, "/apps/evolution/mail/composer",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
- key = "/apps/evolution/mail/composer/outlook_filenames";
- func = (GConfClientNotifyFunc) gconf_outlook_filenames_changed;
- gconf_outlook_filenames_changed (client, 0, NULL, NULL);
- gconf_client_notify_add (client, key, func, NULL, NULL, NULL);
+ settings_outlook_filenames_changed (
+ mail_settings, "composer-outlook-filenames", NULL);
+ g_signal_connect (
+ mail_settings, "changed::composer-outlook-filenames",
+ G_CALLBACK (settings_outlook_filenames_changed), NULL);
/* Display Configuration */
- gconf_client_add_dir (
- client, "/apps/evolution/mail/display",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ g_signal_connect (
+ mail_settings, "changed::address-compress",
+ G_CALLBACK (settings_bool_value_changed), &config->address_compress);
+ config->address_compress = g_settings_get_boolean (mail_settings, "address-compress");
+
+ g_signal_connect (
+ mail_settings, "changed::address-count",
+ G_CALLBACK (settings_int_value_changed), &config->address_count);
+ config->address_count = g_settings_get_int (mail_settings, "address-count");
- key = "/apps/evolution/mail/display/address_compress";
- func = (GConfClientNotifyFunc) gconf_bool_value_changed;
- gconf_client_notify_add (
- client, key, func,
- &config->address_compress, NULL, NULL);
- config->address_compress = gconf_client_get_bool (client, key, NULL);
+ /* Junk Configuration */
- key = "/apps/evolution/mail/display/address_count";
- func = (GConfClientNotifyFunc) gconf_int_value_changed;
- gconf_client_notify_add (
- client, key, func,
- &config->address_count, NULL, NULL);
- config->address_count = gconf_client_get_int (client, key, NULL);
+ g_signal_connect (
+ mail_settings, "changed::junk-check-custom-header",
+ G_CALLBACK (settings_jh_check_changed), session);
+ config->jh_check = g_settings_get_boolean (mail_settings, "junk-check-custom-header");
- /* Font Configuration */
+ g_signal_connect (
+ mail_settings, "changed::junk-custom-header",
+ G_CALLBACK (settings_jh_headers_changed), session);
- gconf_client_add_dir (
- client, "/apps/evolution/mail/display/fonts",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ g_signal_connect (
+ mail_settings, "changed::junk-lookup-addressbook",
+ G_CALLBACK (settings_bool_value_changed), &config->book_lookup);
+ config->book_lookup = g_settings_get_boolean (mail_settings, "junk-lookup-addressbook");
- /* Junk Configuration */
+ g_signal_connect (
+ mail_settings, "changed::junk-lookup-addressbook-local-only",
+ G_CALLBACK (settings_bool_value_changed), &config->book_lookup_local_only);
+ config->book_lookup_local_only = g_settings_get_boolean (mail_settings, "junk-lookup-addressbook-local-only");
- gconf_client_add_dir (
- client, "/apps/evolution/mail/junk",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
- key = "/apps/evolution/mail/junk/check_custom_header";
- func = (GConfClientNotifyFunc) gconf_jh_check_changed;
- gconf_client_notify_add (client, key, func, session, NULL, NULL);
- config->jh_check = gconf_client_get_bool (client, key, NULL);
-
- key = "/apps/evolution/mail/junk/custom_header";
- func = (GConfClientNotifyFunc) gconf_jh_headers_changed;
- gconf_client_notify_add (client, key, func, session, NULL, NULL);
-
- key = "/apps/evolution/mail/junk/lookup_addressbook";
- func = (GConfClientNotifyFunc) gconf_bool_value_changed;
- gconf_client_notify_add (
- client, key, func,
- &config->book_lookup, NULL, NULL);
- config->book_lookup = gconf_client_get_bool (client, key, NULL);
-
- key = "/apps/evolution/mail/junk/lookup_addressbook_local_only";
- func = (GConfClientNotifyFunc) gconf_bool_value_changed;
- gconf_client_notify_add (
- client, key, func,
- &config->book_lookup_local_only, NULL, NULL);
- config->book_lookup_local_only =
- gconf_client_get_bool (client, key, NULL);
-
- gconf_jh_check_changed (client, 0, NULL, session);
-
- g_object_unref (client);
+ settings_jh_check_changed (mail_settings, NULL, session);
}
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index 0c4696b3bd..e95a812b59 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -4351,6 +4351,7 @@ For example: "Work" or "Personal"</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 639e75bfe9..80d6f1ec0c 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -1035,7 +1035,7 @@ vfolder_load_storage (EMailBackend *backend)
MailFolderCache *folder_cache;
EMailSession *session;
gchar *xmlfile;
- GConfClient *client;
+ GSettings *settings;
g_return_if_fail (E_IS_MAIL_BACKEND (backend));
@@ -1112,11 +1112,11 @@ vfolder_load_storage (EMailBackend *backend)
}
/* reenable the feature if required */
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/display/enable_vfolders";
- if (!gconf_client_get_bool (client, key, NULL))
- gconf_client_set_bool (client, key, TRUE, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ key = "enable-vfolders";
+ if (!g_settings_get_boolean (settings, key))
+ g_settings_set_boolean (settings, key, TRUE);
+ g_object_unref (settings);
folder_cache = e_mail_session_get_folder_cache (session);
diff --git a/mail/message-list.c b/mail/message-list.c
index a405959de3..c322f56af1 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -36,8 +36,6 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#include <gconf/gconf-client.h>
-
#include "e-util/e-icon-factory.h"
#include "e-util/e-poolv.h"
#include "e-util/e-util-private.h"
@@ -1975,18 +1973,21 @@ filter_date (time_t date)
static ECell * create_composite_cell (gint col)
{
ECell *cell_vbox, *cell_hbox, *cell_sub, *cell_date, *cell_from, *cell_tree, *cell_attach;
- GConfClient *client;
+ GSettings *settings;
gchar *fixed_name = NULL;
gboolean show_email;
gint alt_col = (col == COL_FROM) ? COL_SENDER : COL_RECIPIENTS;
gboolean same_font = FALSE;
- client = gconf_client_get_default ();
- show_email = gconf_client_get_bool (client, "/apps/evolution/mail/display/show_email", NULL);
- same_font = gconf_client_get_bool (client, "/apps/evolution/mail/display/vertical_view_fonts", NULL);
- if (!same_font)
- fixed_name = gconf_client_get_string (client, "/desktop/gnome/interface/monospace_font_name", NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ show_email = g_settings_get_boolean (settings, "show-email");
+ same_font = g_settings_get_boolean (settings, "vertical-view-fonts");
+ g_object_unref (settings);
+ if (!same_font) {
+ settings = g_settings_new ("org.gnome.desktop.interface");
+ fixed_name = g_settings_get_string (settings, "monospace-font-name");
+ g_object_unref (settings);
+ }
cell_vbox = e_cell_vbox_new ();
@@ -2842,34 +2843,13 @@ message_list_selectable_init (ESelectableInterface *interface)
interface->select_all = message_list_selectable_select_all;
}
-static gboolean
-read_boolean_with_default (GConfClient *gconf,
- const gchar *key,
- gboolean def_value)
-{
- GConfValue *value;
- gboolean res;
-
- g_return_val_if_fail (gconf != NULL, def_value);
- g_return_val_if_fail (key != NULL, def_value);
-
- value = gconf_client_get (gconf, key, NULL);
- if (!value)
- return def_value;
-
- res = gconf_value_get_bool (value);
- gconf_value_free (value);
-
- return res;
-}
-
static void
message_list_construct (MessageList *message_list)
{
AtkObject *a11y;
gboolean constructed;
gchar *etspecfile;
- GConfClient *client;
+ GSettings *settings;
message_list->model =
e_tree_memory_callbacks_new (ml_tree_icon_at,
@@ -2895,15 +2875,13 @@ message_list_construct (MessageList *message_list)
message_list);
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
e_tree_memory_set_expanded_default (
E_TREE_MEMORY (message_list->model),
- read_boolean_with_default (
- client, "/apps/evolution/mail/display/thread_expand", TRUE));
+ g_settings_get_boolean (settings, "thread-expand"));
message_list->priv->thread_latest =
- read_boolean_with_default (
- client, "/apps/evolution/mail/display/thread_latest", TRUE);
- g_object_unref (client);
+ g_settings_get_boolean (settings, "thread-latest");
+ g_object_unref (settings);
/*
* The etree
@@ -3879,7 +3857,7 @@ message_list_set_folder (MessageList *message_list,
{
ETreeModel *etm = message_list->model;
gboolean hide_deleted;
- GConfClient *client;
+ GSettings *settings;
g_return_if_fail (IS_MESSAGE_LIST (message_list));
@@ -3968,9 +3946,9 @@ message_list_set_folder (MessageList *message_list,
folder, "changed",
G_CALLBACK (folder_changed), message_list);
- client = gconf_client_get_default ();
- hide_deleted = !gconf_client_get_bool (client, "/apps/evolution/mail/display/show_deleted", NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ hide_deleted = !g_settings_get_boolean (settings, "show-deleted");
+ g_object_unref (settings);
message_list->hidedeleted =
hide_deleted && non_trash_folder;
@@ -5008,8 +4986,7 @@ mail_regen_list (MessageList *ml,
gboolean scroll_to_cursor)
{
struct _regen_list_msg *m;
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
gboolean thread_subject;
/* report empty search as NULL, not as one/two-space string */
@@ -5026,10 +5003,9 @@ mail_regen_list (MessageList *ml,
mail_regen_cancel (ml);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/display/thread_subject";
- thread_subject = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ thread_subject = g_settings_get_boolean (settings, "thread-subject");
+ g_object_unref (settings);
#ifndef BROKEN_ETREE
/* this can sometimes crash,so ... */