diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-10 21:53:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-17 20:49:12 +0800 |
commit | 2e87aa81fc94f5d9564421e036adae7b48e7380a (patch) | |
tree | 9576f15a49a6101c9246c6ce0f82e5c7bd4575c2 /modules/mailto-handler | |
parent | 95a0ae4afb72b534c991fbcd774733a93f256514 (diff) | |
download | gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.gz gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.bz2 gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.lz gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.xz gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.zst gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.zip |
Remove EMailShellSettings.
EShellSettings predates GSettings and is no longer necessary.
GSettings allows binding GObject properties to GSettings keys,
with optional mapping functions. That fulfills the purpose of
EShellSettings.
Diffstat (limited to 'modules/mailto-handler')
-rw-r--r-- | modules/mailto-handler/evolution-mailto-handler.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/modules/mailto-handler/evolution-mailto-handler.c b/modules/mailto-handler/evolution-mailto-handler.c index b6f3656863..f985562487 100644 --- a/modules/mailto-handler/evolution-mailto-handler.c +++ b/modules/mailto-handler/evolution-mailto-handler.c @@ -102,8 +102,7 @@ mailto_handler_is_evolution (GAppInfo *app_info) static gboolean mailto_handler_prompt (EMailtoHandler *extension) { - EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; GtkWidget *container; GtkWidget *dialog; GtkWidget *widget; @@ -111,9 +110,6 @@ mailto_handler_prompt (EMailtoHandler *extension) gchar *markup; gint response; - shell = mailto_handler_get_shell (extension); - shell_settings = e_shell_get_shell_settings (shell); - dialog = gtk_dialog_new_with_buttons ( "", NULL, 0, GTK_STOCK_NO, GTK_RESPONSE_NO, @@ -156,12 +152,16 @@ mailto_handler_prompt (EMailtoHandler *extension) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 12); gtk_widget_show (widget); - g_object_bind_property ( - shell_settings, "mailto-handler-check", + settings = g_settings_new ("org.gnome.evolution.mail"); + + g_settings_bind ( + settings, "prompt-check-if-default-mailer", widget, "active", - G_BINDING_BIDIRECTIONAL | - G_BINDING_SYNC_CREATE | - G_BINDING_INVERT_BOOLEAN); + G_SETTINGS_BIND_GET | + G_SETTINGS_BIND_SET | + G_SETTINGS_BIND_INVERT_BOOLEAN); + + g_object_unref (settings); /* Direct input focus away from the checkbox. */ widget = gtk_dialog_get_widget_for_response ( @@ -178,19 +178,17 @@ mailto_handler_prompt (EMailtoHandler *extension) static void mailto_handler_check (EMailtoHandler *extension) { - EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; gboolean check_mailto_handler = TRUE; GAppInfo *app_info = NULL; GError *error = NULL; - shell = mailto_handler_get_shell (extension); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.mail"); - g_object_get ( - shell_settings, - "mailto-handler-check", &check_mailto_handler, - NULL); + check_mailto_handler = g_settings_get_boolean ( + settings, "prompt-check-if-default-mailer"); + + g_object_unref (settings); /* Should we check the "mailto" URI handler? */ if (!check_mailto_handler) @@ -245,11 +243,6 @@ mailto_handler_constructed (GObject *object) shell = mailto_handler_get_shell (extension); - e_shell_settings_install_property_for_key ( - "mailto-handler-check", - "org.gnome.evolution.mail", - "prompt-check-if-default-mailer"); - g_signal_connect_swapped ( shell, "event::ready-to-start", G_CALLBACK (mailto_handler_check), extension); |