Support mailto: by passing it to gtk_show_uri or Exo

This commit is contained in:
Christian Dywan 2009-03-26 23:46:36 +01:00
parent e6ea06afd3
commit 73b26c53f9
2 changed files with 12 additions and 2 deletions

View file

@ -1803,6 +1803,16 @@ midori_view_set_uri (MidoriView* view,
{
midori_view_execute_script (view, &uri[11], NULL);
}
else if (g_str_has_prefix (uri, "mailto:"))
{
if (!gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL))
{
/* Fallback to Exo for example if GConf isn't setup */
gchar* command = g_strconcat ("exo-open ", uri, NULL);
g_spawn_command_line_async (command, NULL);
g_free (command);
}
}
else
{
katze_assign (view->uri, g_strdup (uri));

View file

@ -220,8 +220,8 @@ sokoke_magic_uri (const gchar* uri,
g_return_val_if_fail (!search_engines ||
katze_array_is_a (search_engines, KATZE_TYPE_ITEM), NULL);
/* Just return if it's a javascript: uri */
if (g_str_has_prefix (uri, "javascript:"))
/* Just return if it's a javascript: or mailto: uri */
if (g_str_has_prefix (uri, "javascript:") || g_str_has_prefix (uri, "mailto:"))
return g_strdup (uri);
/* Add file:// if we have a local path */
if (g_path_is_absolute (uri))