[Xfce4-commits] <exo:master> Try ftp(s) scheme in file manager first.

Nick Schermer noreply at xfce.org
Sat Nov 13 20:12:02 CET 2010


Updating branch refs/heads/master
         to 06b301b3ab7da5b9292848a6bff148ded5101f87 (commit)
       from dbd731ff291c5128109546832d25f3b061f5afc0 (commit)

commit 06b301b3ab7da5b9292848a6bff148ded5101f87
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Nov 13 20:10:50 2010 +0100

    Try ftp(s) scheme in file manager first.

 exo-open/main.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/exo-open/main.c b/exo-open/main.c
index 526a416..7ff32aa 100644
--- a/exo-open/main.c
+++ b/exo-open/main.c
@@ -85,8 +85,8 @@ struct _KnownSchemes
 
 static KnownSchemes known_schemes[] =
 {
-  { "^(https?|ftps?|gopher)$", "WebBrowser" },
-  { "^mailto$",                "MailReader" },
+  { "^(https?|gopher)$", "WebBrowser" },
+  { "^mailto$",          "MailReader" },
 };
 
 
@@ -369,17 +369,24 @@ exo_open_uri (const gchar  *uri,
     }
 
   g_object_unref (G_OBJECT (file));
-  g_free (scheme);
 
   /* our last try... */
   if (!succeed)
     {
 #ifndef NDEBUG
-      g_debug ("use gtk_show_uri()");
+          g_debug ("nothing worked, try ftp(s) or gtk_show_uri()");
 #endif
-      retval = gtk_show_uri (NULL, uri, 0, error);
+
+      /* try ftp uris if the file manager/gio failed to recognize it */
+      if (g_strcmp0 (scheme, "ftp") == 0
+          || g_strcmp0 (scheme, "ftps") == 0)
+        retval = exo_open_launch_category ("WebBrowser", uri);
+      else
+        retval = gtk_show_uri (NULL, uri, 0, error);
     }
 
+  g_free (scheme);
+
   return retval;
 }
 



More information about the Xfce4-commits mailing list