diff options
Diffstat (limited to 'modules')
22 files changed, 248 insertions, 282 deletions
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index 92341e4a3f..ab21d689fa 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -245,11 +245,10 @@ action_contact_new_cb (GtkAction *action, { EShell *shell; EShellBackend *shell_backend; - GConfClient *client; + GSettings *settings; ESourceList *source_list; ESource *source = NULL; const gchar *action_name; - const gchar *key; gchar *uid; /* This callback is used for both contacts and contact lists. */ @@ -260,9 +259,9 @@ action_contact_new_cb (GtkAction *action, g_object_get (shell_backend, "source-list", &source_list, NULL); g_return_if_fail (E_IS_SOURCE_LIST (source_list)); - client = e_shell_get_gconf_client (shell); - key = "/apps/evolution/addressbook/display/primary_addressbook"; - uid = gconf_client_get_string (client, key, NULL); + settings = g_settings_new ("org.gnome.evolution.addressbook"); + uid = g_settings_get_string (settings, "primary-addressbook"); + g_object_unref (settings); if (uid != NULL) { source = e_source_list_peek_source_by_uid (source_list, uid); diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index e8f2afd83b..f4c3d74784 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -28,7 +28,6 @@ #include <glib/gi18n.h> #include "e-util/e-selection.h" -#include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" #include "widgets/misc/e-paned.h" #include "widgets/misc/e-preview-pane.h" @@ -82,23 +81,18 @@ book_shell_content_restore_state_cb (EShellWindow *shell_window, EShellContent *shell_content) { EBookShellContentPrivate *priv; - GConfBridge *bridge; - GObject *object; - const gchar *key; + GSettings *settings; priv = E_BOOK_SHELL_CONTENT (shell_content)->priv; - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to GSettings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.addressbook"); - object = G_OBJECT (priv->paned); - key = "/apps/evolution/addressbook/display/hpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); + g_settings_bind (settings, "hpane-position", priv->paned, "hposition", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "vpane-position", priv->paned, "vposition", G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (priv->paned); - key = "/apps/evolution/addressbook/display/vpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); + g_object_unref (settings); } static GtkOrientation diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index a6aebe08a2..e967b1141b 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -1147,7 +1147,7 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) EPreviewPane *preview_pane; EWebView *web_view; GtkActionGroup *action_group; - GConfBridge *bridge; + GSettings *settings; GtkAction *action; GObject *object; const gchar *key; @@ -1206,21 +1206,20 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) action_group, lockdown_save_to_disk_popup_entries, G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to GSettings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.addressbook"); object = G_OBJECT (ACTION (CONTACT_PREVIEW)); - key = "/apps/evolution/addressbook/display/show_preview"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (settings, "show-preview", object, "active", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (CONTACT_VIEW_VERTICAL)); - key = "/apps/evolution/addressbook/display/layout"; - gconf_bridge_bind_property (bridge, key, object, "current-value"); + g_settings_bind (settings, "layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (CONTACT_PREVIEW_SHOW_MAPS)); - key = "/apps/evolution/addressbook/display/preview_show_maps"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (settings, "preview-show-maps", object, "active", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); /* Fine tuning. */ diff --git a/modules/bogofilter/evolution-bogofilter.c b/modules/bogofilter/evolution-bogofilter.c index 1d0c99abd4..4521b7a6a1 100644 --- a/modules/bogofilter/evolution-bogofilter.c +++ b/modules/bogofilter/evolution-bogofilter.c @@ -23,7 +23,6 @@ #include <camel/camel.h> -#include <e-util/gconf-bridge.h> #include <mail/e-mail-junk-filter.h> /* Standard GObject macros */ @@ -505,10 +504,11 @@ e_bogofilter_interface_init (CamelJunkFilterInterface *interface) static void e_bogofilter_init (EBogofilter *extension) { - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/bogofilter/unicode", - G_OBJECT (extension), "convert-to-unicode"); + GSettings *settings; + + settings = g_settings_new ("org.gnome.evolution.eplugin.bogo-junk"); + g_settings_bind (settings, "utf8-for-spam-filter", G_OBJECT (extension), "convert-to-unicode", G_SETTINGS_BIND_DEFAULT); + g_object_unref (settings); } G_MODULE_EXPORT void diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 5693994277..625969871f 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -901,18 +901,24 @@ e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend) GSList * e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend) { - GConfClient *client; - GSList *selected_calendars; - const gchar *key; + GSettings *settings; + char **strv; + gint i; + GSList *selected_calendars = NULL; g_return_val_if_fail ( E_IS_CAL_SHELL_BACKEND (cal_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/display/selected_calendars"; - selected_calendars = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-calendars"); + g_object_unref (settings); + + if (strv != NULL) { + for (i = 0; strv[i] != NULL; i++) + selected_calendars = g_slist_append (selected_calendars, g_strdup (strv[i])); + + g_strfreev (strv); + } return selected_calendars; } @@ -921,16 +927,21 @@ void e_cal_shell_backend_set_selected_calendars (ECalShellBackend *cal_shell_backend, GSList *selected_calendars) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *l; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/display/selected_calendars"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_calendars, NULL); - g_object_unref (client); + for (l = selected_calendars; l != NULL; l = l->next) + g_ptr_array_add (array, l->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-calendars", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } void diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 81fc76b3cb..5e60ecd82b 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -28,7 +28,6 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/gconf-bridge.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" #include "widgets/misc/e-selectable.h" @@ -53,8 +52,6 @@ struct _ECalShellContentPrivate { GtkWidget *memo_table; GalViewInstance *view_instance; - - guint paned_binding_id; }; enum { @@ -111,32 +108,28 @@ cal_shell_content_notify_view_id_cb (ECalShellContent *cal_shell_content) { EShellContent *shell_content; EShellView *shell_view; - GConfBridge *bridge; + GSettings *settings; GtkWidget *paned; - guint binding_id; const gchar *key; const gchar *view_id; - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); paned = cal_shell_content->priv->hpaned; - binding_id = cal_shell_content->priv->paned_binding_id; shell_content = E_SHELL_CONTENT (cal_shell_content); shell_view = e_shell_content_get_shell_view (shell_content); view_id = e_shell_view_get_view_id (shell_view); - if (binding_id > 0) - gconf_bridge_unbind (bridge, binding_id); - if (view_id != NULL && strcmp (view_id, "Month_View") == 0) - key = "/apps/evolution/calendar/display/month_hpane_position"; + key = "month-hpane-position"; else - key = "/apps/evolution/calendar/display/hpane_position"; + key = "hpane-position"; - binding_id = gconf_bridge_bind_property_delayed ( - bridge, key, G_OBJECT (paned), "hposition"); + g_settings_unbind (settings, key); - cal_shell_content->priv->paned_binding_id = binding_id; + g_settings_bind (settings, key, G_OBJECT (paned), "hposition", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); } static gchar * @@ -332,7 +325,7 @@ cal_shell_content_constructed (GObject *object) EShellView *foreign_view; GnomeCalendar *calendar; GalViewInstance *view_instance; - GConfBridge *bridge; + GSettings *settings; GtkWidget *container; GtkWidget *widget; const gchar *key; @@ -521,11 +514,12 @@ cal_shell_content_constructed (GObject *object) G_CALLBACK (cal_shell_content_notify_view_id_cb), object); - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (priv->vpaned); - key = "/apps/evolution/calendar/display/tag_vpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "proportion"); + g_settings_bind (settings, "tag-vpane-position", object, "proportion", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); } if (memo_model) diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 77c5639a78..f896db6136 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -30,7 +30,6 @@ #include <libedataserverui/e-client-utils.h> #include "e-util/e-alert-dialog.h" -#include "e-util/gconf-bridge.h" #include "widgets/misc/e-paned.h" #include "calendar/gui/e-calendar-selector.h" @@ -523,7 +522,7 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, ESourceSelector *selector; ESourceList *source_list; ESource *source; - GConfBridge *bridge; + GSettings *settings; GtkTreeModel *model; GSList *list, *iter; GObject *object; @@ -585,13 +584,14 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, G_CALLBACK (cal_shell_sidebar_selection_changed_cb), shell_sidebar); - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to settings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/date_navigator_pane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); + g_settings_bind (settings, "date-navigator-pane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (settings)); } static void diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c index 85eddd9736..5578f39a2c 100644 --- a/modules/calendar/e-calendar-preferences.c +++ b/modules/calendar/e-calendar-preferences.c @@ -329,13 +329,13 @@ static void notify_with_tray_toggled (GtkToggleButton *toggle, ECalendarPreferences *prefs) { - GConfClient *gconf; + GSettings *settings; g_return_if_fail (toggle != NULL); - gconf = gconf_client_get_default (); - gconf_client_set_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", gtk_toggle_button_get_active (toggle), NULL); - g_object_unref (gconf); + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_boolean (settings, "notify-with-tray", gtk_toggle_button_get_active (toggle)); + g_object_unref (settings); } static void @@ -454,7 +454,7 @@ initialize_selection (ESourceSelector *selector, static void show_alarms_config (ECalendarPreferences *prefs) { - GConfClient *gconf; + GSettings *settings; if (e_cal_client_get_sources (&prefs->alarms_list, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL)) { prefs->alarm_list_widget = e_source_selector_new (prefs->alarms_list); @@ -464,9 +464,9 @@ show_alarms_config (ECalendarPreferences *prefs) initialize_selection (E_SOURCE_SELECTOR (prefs->alarm_list_widget), prefs->alarms_list); } - gconf = gconf_client_get_default (); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), gconf_client_get_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", NULL)); - g_object_unref (gconf); + settings = g_settings_new ("org.gnome.evolution.calendar"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), g_settings_get_boolean (settings, "notify-with-tray")); + g_object_unref (settings); } /* Shows the current config settings in the dialog. */ diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index ed4e81d559..abbfdf7e0f 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -645,18 +645,25 @@ e_memo_shell_backend_get_source_list (EMemoShellBackend *memo_shell_backend) GSList * e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_backend) { - GConfClient *client; - GSList *selected_memo_lists; - const gchar *key; + GSettings *settings; + char **strv; + gint i; + GSList *selected_memo_lists = NULL; g_return_val_if_fail ( E_IS_MEMO_SHELL_BACKEND (memo_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/memos/selected_memos"; - selected_memo_lists = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-memos"); + g_object_unref (settings); + + + if (strv != NULL) { + for (i = 0; strv[i] != NULL; i++) + selected_memo_lists = g_slist_append (selected_memo_lists, g_strdup (strv[i])); + + g_strfreev (strv); + } return selected_memo_lists; } @@ -665,14 +672,19 @@ void e_memo_shell_backend_set_selected_memo_lists (EMemoShellBackend *memo_shell_backend, GSList *selected_memo_lists) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *l; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_MEMO_SHELL_BACKEND (memo_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/memos/selected_memos"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_memo_lists, NULL); - g_object_unref (client); + for (l = selected_memo_lists; l != NULL; l = l->next) + g_ptr_array_add (array, l->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-memos", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index f0f4fe958f..60936ccb8c 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -28,7 +28,6 @@ #include <glib/gi18n.h> #include "e-util/e-selection.h" -#include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" @@ -273,23 +272,20 @@ memo_shell_content_restore_state_cb (EShellWindow *shell_window, EShellContent *shell_content) { EMemoShellContentPrivate *priv; - GConfBridge *bridge; + GSettings *settings; GObject *object; - const gchar *key; priv = E_MEMO_SHELL_CONTENT (shell_content)->priv; - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to settings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/memo_hpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); + g_settings_bind (settings, "memo-hpane-position", object, "hposition", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/memo_vpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); + g_settings_bind (settings, "memo-vpane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT); } static GtkOrientation diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index d71b893fe3..c832066b59 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -863,7 +863,7 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) EPreviewPane *preview_pane; EWebView *web_view; GtkActionGroup *action_group; - GConfBridge *bridge; + GSettings *memo_settings; GtkAction *action; GObject *object; const gchar *key; @@ -922,17 +922,17 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) action_group, lockdown_save_to_disk_popup_entries, G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to settings keys. */ - bridge = gconf_bridge_get (); + memo_settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (ACTION (MEMO_PREVIEW)); - key = "/apps/evolution/calendar/display/show_memo_preview"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (memo_settings, "show-memo-preview", object, "active", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (MEMO_VIEW_VERTICAL)); - key = "/apps/evolution/calendar/display/memo_layout"; - gconf_bridge_bind_property (bridge, key, object, "current-value"); + g_settings_bind (memo_settings, "memo-layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (memo_settings)); /* Fine tuning. */ diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index 2fc8ce1e5f..39dcf4e726 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -650,18 +650,24 @@ e_task_shell_backend_get_source_list (ETaskShellBackend *task_shell_backend) GSList * e_task_shell_backend_get_selected_task_lists (ETaskShellBackend *task_shell_backend) { - GConfClient *client; - GSList *selected_task_lists; - const gchar *key; + GSettings *settings; + char **strv; + gint i; + GSList *selected_task_lists = NULL; g_return_val_if_fail ( E_IS_TASK_SHELL_BACKEND (task_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/tasks/selected_tasks"; - selected_task_lists = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-tasks"); + g_object_unref (G_OBJECT (settings)); + + if (strv != NULL) { + for (i = 0; strv[i] != NULL; i++) + selected_task_lists = g_slist_append (selected_task_lists, g_strdup (strv[i])); + + g_strfreev (strv); + } return selected_task_lists; } @@ -670,14 +676,19 @@ void e_task_shell_backend_set_selected_task_lists (ETaskShellBackend *task_shell_backend, GSList *selected_task_lists) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *l; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_TASK_SHELL_BACKEND (task_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/tasks/selected_tasks"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_task_lists, NULL); - g_object_unref (client); + for (l = selected_task_lists; l != NULL; l = l->next) + g_ptr_array_add (array, l->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-tasks", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 743bb937e7..cb2443f19d 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -28,7 +28,6 @@ #include <glib/gi18n.h> #include "e-util/e-selection.h" -#include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" @@ -271,23 +270,22 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window, EShellContent *shell_content) { ETaskShellContentPrivate *priv; - GConfBridge *bridge; + GSettings *settings; GObject *object; - const gchar *key; priv = E_TASK_SHELL_CONTENT (shell_content)->priv; - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to settings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/task_hpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); + g_settings_bind (settings, "task-hpane-position", object, "hposition", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/task_vpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); + g_settings_bind (settings, "task-vpane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (settings)); } static GtkOrientation diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 2fe28494ac..c7e91d2955 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1062,10 +1062,9 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) EPreviewPane *preview_pane; EWebView *web_view; GtkActionGroup *action_group; - GConfBridge *bridge; + GSettings *settings; GtkAction *action; GObject *object; - const gchar *key; shell_view = E_SHELL_VIEW (task_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -1121,17 +1120,17 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) action_group, lockdown_save_to_disk_popup_entries, G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); - /* Bind GObject properties to GConf keys. */ + /* Bind GObject properties to settings keys. */ - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (ACTION (TASK_PREVIEW)); - key = "/apps/evolution/calendar/display/show_task_preview"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (settings, "show-task-preview", object, "active", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (TASK_VIEW_VERTICAL)); - key = "/apps/evolution/calendar/display/task_layout"; - gconf_bridge_bind_property (bridge, key, object, "current-value"); + g_settings_bind (settings, "task-layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (settings)); /* Fine tuning. */ 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 f752506306..dc94c5c9ed 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -376,7 +376,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"; @@ -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. */ diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c index ddf51d815e..4bd6c1c968 100644 --- a/modules/mail/em-account-prefs.c +++ b/modules/mail/em-account-prefs.c @@ -117,6 +117,7 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view, EMAccountPrefs *prefs) { EAccountList *account_list; + EMailSession *session; EAccount *account; EMailSession *session; gpointer parent; @@ -325,6 +326,7 @@ account_prefs_delete_account (EAccountManager *manager) EMAccountPrefsPrivate *priv; EAccountTreeView *tree_view; EAccountList *account_list; + EMailSession *session; EAccount *account; EMailSession *session; gboolean has_proxies; diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c index 290e189e4b..b04c35b088 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 i; + + strv = g_settings_get_strv (prefs->settings, "junk-custom-header"); gtk_list_store_clear (store); - for (l = cjh; l; l = l->next) { + for (i = 0; strv[i] != NULL; i++) { GtkTreeIter iter; - gchar **tokens = g_strsplit (l->data, "=", 2); + gchar **tokens = g_strsplit (strv[i], "=", 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 i; + 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 (i = 0; strv[i] != NULL; i++) + g_ptr_array_add (array, strv[i]); 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", 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); @@ -237,38 +238,32 @@ 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)) { 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; + GPtrArray *array = g_ptr_array_new (); + gint i; + + 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 (i = 0; strv[i] != NULL; i++) { gchar *test; gint len = strlen (name); - test = strncmp (node->data, name, len) == 0 ? (gchar *) node->data + len : NULL; + test = strncmp (strv[i], name, len) == 0 ? (gchar *) strv[i] + len : NULL; if (test) { test++; if (strcmp (test, value) == 0) - break; + continue; } - prev = node; - node = node->next; + g_ptr_array_add (array, strv[i]); } - 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", 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,7 +534,7 @@ toggle_button_init (EMMailerPrefs *prefs, g_signal_connect (toggle, "toggled", toggled, prefs); } - if (!gconf_client_key_is_writable (prefs->gconf, key, NULL)) + if (!g_settings_is_writable (prefs->settings, key) gtk_widget_set_sensitive ((GtkWidget *) toggle, FALSE); } @@ -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..eee2d248ac 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> @@ -56,7 +55,7 @@ struct _EMMailerPrefs { GtkVBox parent_object; GtkBuilder *builder; - GConfClient *gconf; + GSettings *settings; /* General tab */ @@ -81,7 +80,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; diff --git a/modules/network-manager/Makefile.am b/modules/network-manager/Makefile.am index 81b61ac864..2d87b22acf 100644 --- a/modules/network-manager/Makefile.am +++ b/modules/network-manager/Makefile.am @@ -6,6 +6,7 @@ libevolution_module_network_manager_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"evolution-network-manager\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(SHELL_CFLAGS) \ $(NM_CFLAGS) libevolution_module_network_manager_la_SOURCES = \ diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c index b578acf228..a628753aba 100644 --- a/modules/spamassassin/evolution-spamassassin.c +++ b/modules/spamassassin/evolution-spamassassin.c @@ -25,7 +25,6 @@ #include <shell/e-shell.h> #include <e-util/e-mktemp.h> -#include <e-util/gconf-bridge.h> #include <mail/e-mail-junk-filter.h> /* Standard GObject macros */ @@ -1074,7 +1073,7 @@ e_spam_assassin_class_init (ESpamAssassinClass *class) junk_filter_class->available = spam_assassin_available; junk_filter_class->new_config_widget = spam_assassin_new_config_widget; - /* XXX Argh, the boolean sense of the GConf key is inverted from + /* XXX Argh, the boolean sense of the GSettings key is inverted from * that of the checkbox widget. The checkbox wording is more * natural, but GConfBridge doesn't support transform functions * so the property has to match the sense of the GConf key. */ @@ -1146,36 +1145,23 @@ e_spam_assassin_interface_init (CamelJunkFilterInterface *interface) static void e_spam_assassin_init (ESpamAssassin *extension) { + GSettings *settings; + extension->socket_path_mutex = g_mutex_new (); /* XXX Once we move to GSettings these probably don't * need to be properties anymore. GConfBridge is * just easier to deal with than GConfClient. */ - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/local_only", - G_OBJECT (extension), "local-only"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/spamc_binary", - G_OBJECT (extension), "spamc-binary"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/spamd_binary", - G_OBJECT (extension), "spamd-binary"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/socket_path", - G_OBJECT (extension), "socket-path"); - - gconf_bridge_bind_property ( - gconf_bridge_get (), - "/apps/evolution/mail/junk/sa/use_daemon", - G_OBJECT (extension), "use-daemon"); + settings = g_settings_new ("org.gnome.evolution.mail"); + + g_settings_bind (settings, "junk-sa-local-only", G_OBJECT (extension), "local-only", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-spamc-binary", G_OBJECT (extension), "spamc-binary", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-spamd-binary", G_OBJECT (extension), "spamd-binary", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-socjet-path", G_OBJECT (extension), "socket-path", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (settings, "junk-sa-use-daemon", G_OBJECT (extension), "use-daemon", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); if (extension->spamc_binary == NULL) extension->spamc_binary = g_strdup (SPAMC_BINARY); |