[nautilus-sendto] evolution: Fix getting default mailer for GNOME 3.0
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-sendto] evolution: Fix getting default mailer for GNOME 3.0
- Date: Wed, 14 Mar 2012 15:32:27 +0000 (UTC)
commit dc61f9a50d80b965650288260d01ca2385aa9e5b
Author: Bastien Nocera <hadess hadess net>
Date: Wed Mar 14 16:29:26 2012 +0100
evolution: Fix getting default mailer for GNOME 3.0
Using the handler for x-scheme-handler/mailto rather than
reading obsolete info in GConf.
https://bugzilla.gnome.org/show_bug.cgi?id=667780
src/plugins/evolution/evolution.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/evolution/evolution.c b/src/plugins/evolution/evolution.c
index 7981a7d..d7be9b2 100644
--- a/src/plugins/evolution/evolution.c
+++ b/src/plugins/evolution/evolution.c
@@ -66,8 +66,6 @@ struct _EvolutionPluginClass {
NAUTILUS_PLUGIN_REGISTER(EVOLUTION_TYPE_PLUGIN, EvolutionPlugin, evolution_plugin)
-#define DEFAULT_MAILTO "/desktop/gnome/url-handlers/mailto/command"
-
#define CONTACT_FORMAT "%s <%s>"
static char *
@@ -102,7 +100,7 @@ get_evo_cmd (void)
static void
evolution_plugin_init (EvolutionPlugin *p)
{
- GConfClient *client;
+ GAppInfo *app_info;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -111,9 +109,13 @@ evolution_plugin_init (EvolutionPlugin *p)
p->email = NULL;
p->name = NULL;
- client = gconf_client_get_default ();
- p->mail_cmd = gconf_client_get_string (client, DEFAULT_MAILTO, NULL);
- g_object_unref (client);
+ app_info = g_app_info_get_default_for_uri_scheme ("mailto");
+ if (app_info) {
+ mail_cmd = g_strdup (g_app_info_get_commandline (app_info));
+ g_object_unref (app_info);
+ } else {
+ mail_cmd = NULL;
+ }
if (p->mail_cmd == NULL || *p->mail_cmd == '\0') {
g_free (p->mail_cmd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]