summaryrefslogtreecommitdiff
path: root/nautilus-sendto-extension
diff options
context:
space:
mode:
authorPlamena Manolova <plamena.n.manolova@intel.com>2013-06-04 13:05:24 +0100
committerCosimo Cecchi <cosimo@endlessm.com>2013-06-07 14:49:15 -0700
commit837091b55d41b118d4a8a7fb35bbd8c96326012f (patch)
tree9c0d7d4023e635680a0f5a8b726ff1da3e040917 /nautilus-sendto-extension
parent034806e4b04427a06f3ed5c4740e1c0218d1f25c (diff)
downloadnautilus-837091b55d41b118d4a8a7fb35bbd8c96326012f.tar.gz
sendto-extension: Check for available mail client
The sendto extension now checks for an available client supported by nautilus sendto and conditionaly adds the "Email" option to the file menu list. https://bugzilla.gnome.org/show_bug.cgi?id=701653
Diffstat (limited to 'nautilus-sendto-extension')
-rw-r--r--nautilus-sendto-extension/nautilus-nste.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/nautilus-sendto-extension/nautilus-nste.c b/nautilus-sendto-extension/nautilus-nste.c
index f63721199..3e09835c6 100644
--- a/nautilus-sendto-extension/nautilus-nste.c
+++ b/nautilus-sendto-extension/nautilus-nste.c
@@ -56,6 +56,20 @@ sendto_callback (NautilusMenuItem *item,
g_string_free (cmd, TRUE);
}
+static gboolean
+check_available_mailer ()
+{
+ GAppInfo *app_info;
+
+ app_info = g_app_info_get_default_for_uri_scheme ("mailto");
+ if (app_info) {
+ g_clear_object (&app_info);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
static GList *
nautilus_nste_get_file_items (NautilusMenuProvider *provider,
GtkWidget *window,
@@ -72,6 +86,9 @@ nautilus_nste_get_file_items (NautilusMenuProvider *provider,
if (files == NULL)
return NULL;
+
+ if (!check_available_mailer ())
+ return NULL;
one_item = (files != NULL) && (files->next == NULL);
if (one_item &&
@@ -161,4 +178,3 @@ nautilus_nste_register_type (GTypeModule *module)
NAUTILUS_TYPE_MENU_PROVIDER,
&menu_provider_iface_info);
}
-