Commit 837091b5 authored by Plamena Manolova's avatar Plamena Manolova Committed by Cosimo Cecchi

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
parent 034806e4
......@@ -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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment