[Xfce4-commits] <terminal:master> Use exo preferred directly to open uris (bug #7140).

Nick Schermer noreply at xfce.org
Sat Jun 4 10:14:01 CEST 2011


Updating branch refs/heads/master
         to c5cbf887baa8f4ffb0b205b2c69d031efd9a2367 (commit)
       from 1c93421c73f6d724f2d09bc54ab3a8d73c3fe69a (commit)

commit c5cbf887baa8f4ffb0b205b2c69d031efd9a2367
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Jun 4 10:12:09 2011 +0200

    Use exo preferred directly to open uris (bug #7140).
    
    gtk_uri_show is not reliable, so use exo directly to open
    links and email addresses.

 terminal/terminal-widget.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index dac2df8..7087516 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -659,10 +659,11 @@ terminal_widget_open_uri (TerminalWidget *widget,
                           const gchar    *wlink,
                           gint            tag)
 {
-  GError    *error = NULL;
-  gchar     *uri;
-  guint      i;
-  GdkScreen *screen;
+  GError      *error = NULL;
+  gchar       *uri;
+  guint        i;
+  GdkScreen   *screen;
+  const gchar *category = "WebBrowser";
 
   for (i = 0; i < G_N_ELEMENTS (regex_patterns); i++)
     {
@@ -682,6 +683,9 @@ terminal_widget_open_uri (TerminalWidget *widget,
             break;
 
           case PATTERN_TYPE_EMAIL:
+            /* other category then WebBrowser */
+            category = "MailReader";
+
             if (strncmp (wlink, "mailto:", 7) == 0)
               uri = g_strdup (wlink);
             else
@@ -694,11 +698,7 @@ terminal_widget_open_uri (TerminalWidget *widget,
 
       /* try to open the URI with the responsible application */
       screen = gtk_widget_get_screen (GTK_WIDGET (widget));
-#if EXO_CHECK_VERSION (0, 5, 0)
-      if (!gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error))
-#else
-      if (!exo_url_show_on_screen (uri, NULL, screen, &error))
-#endif
+      if (!exo_execute_preferred_application_on_screen (category, uri, NULL, NULL, screen, &error))
         {
           /* tell the user that we were unable to open the responsible application */
           terminal_dialogs_show_error (widget, error, _("Failed to open the URL `%s'"), uri);



More information about the Xfce4-commits mailing list