]> www.fi.muni.cz Git - evince.git/commitdiff
Assume invalid uris are http uris. Fixes bug #552071.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sat, 13 Sep 2008 10:58:11 +0000 (10:58 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sat, 13 Sep 2008 10:58:11 +0000 (10:58 +0000)
2008-09-13  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-window.c: (launch_external_uri):

Assume invalid uris are http uris. Fixes bug #552071.

svn path=/trunk/; revision=3176

ChangeLog
shell/ev-window.c

index 019ad7e26eb98eb66c7132a9bbfec2d9f1a1e67f..f418b99024377e03c64596ce355d9d3693a8af0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-13  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (launch_external_uri):
+
+       Assume invalid uris are http uris. Fixes bug #552071.
+       
 2008-09-09  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * NEWS:
index 9f27479c7f6c496228344c2538b4fcbe194eac66..e6b0903f1adea9c8baec2653958490c0bd54f6e8 100644 (file)
@@ -4886,8 +4886,18 @@ launch_external_uri (EvWindow *window, EvLinkAction *action)
        const gchar *uri = ev_link_action_get_uri (action);
        GError *error = NULL;
        gboolean ret;
+
+       if (!g_strstr_len (uri, strlen (uri), "://")) {
+               gchar *http;
+               
+               /* Not a valid uri, assuming it's http */
+               http = g_strdup_printf ("http://%s", uri);
+               ret = g_app_info_launch_default_for_uri (http, NULL, &error);
+               g_free (http);
+       } else {
+               ret = g_app_info_launch_default_for_uri (uri, NULL, &error);
+       }
        
-       ret = g_app_info_launch_default_for_uri (uri, NULL, &error);
        if (ret == FALSE) {
                GtkWidget *dialog;