aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-10-28 18:05:31 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-10-28 18:05:31 +0800
commit2782363bf143089e92f277b844505ef34f46e69c (patch)
tree28b1f3cafcb28302f7203226afb70cf08f9f9bd6
parentb3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89 (diff)
downloadgsoc2013-evolution-2782363bf143089e92f277b844505ef34f46e69c.tar.gz
gsoc2013-evolution-2782363bf143089e92f277b844505ef34f46e69c.tar.zst
gsoc2013-evolution-2782363bf143089e92f277b844505ef34f46e69c.zip
Mail module has now all basic settings in GSettings
-rw-r--r--modules/mail/e-mail-shell-backend.c56
-rw-r--r--modules/mail/e-mail-shell-content.c1
-rw-r--r--modules/mail/e-mail-shell-view-actions.c14
3 files changed, 21 insertions, 50 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index ce563124c6..bc801dabf8 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -481,7 +481,7 @@ mail_shell_backend_delete_junk_policy_decision (EMailBackend *backend)
{
EShell *shell;
EShellSettings *shell_settings;
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
gboolean delete_junk;
gint empty_date;
@@ -491,7 +491,7 @@ mail_shell_backend_delete_junk_policy_decision (EMailBackend *backend)
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;
@@ -504,32 +504,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;
}
@@ -538,7 +524,7 @@ mail_shell_backend_empty_trash_policy_decision (EMailBackend *backend)
{
EShell *shell;
EShellSettings *shell_settings;
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
gboolean empty_trash;
gint empty_date;
@@ -548,7 +534,7 @@ mail_shell_backend_empty_trash_policy_decision (EMailBackend *backend)
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;
@@ -561,32 +547,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-content.c b/modules/mail/e-mail-shell-content.c
index 9fd7d3b91a..7918930736 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -29,7 +29,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"
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 08cdfd81e4..dc94c5c9ed 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -1631,7 +1631,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;
@@ -1689,17 +1689,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. */