[frogr] Use `gio open` instead of gvfs-open as a fallback when possible



commit 0241520b657f064d786b21dfa6f6923a4e7b9d5f
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Wed Dec 27 02:30:15 2017 +0100

    Use `gio open` instead of gvfs-open as a fallback when possible
    
    This also requires GLib 2.50, which should be a perfectly reasonable
    by now since that's shipped by Debian Stable but turns out it's not
    yet in the latest Ubuntu LTS (Xenial, has GLib 2.48), so don't raise
    the version of the dependency and just use gio or gvfs-open depending
    on the version of GLib available.

 src/frogr-util.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/frogr-util.c b/src/frogr-util.c
index fcd1db8..875f283 100644
--- a/src/frogr-util.c
+++ b/src/frogr-util.c
@@ -117,12 +117,16 @@ _open_uris_with_app_info (GList *uris_list, GAppInfo *app_info)
 
   if (!app_info || !g_app_info_launch_uris (app_info, uris_list, NULL, &error))
     {
-      /* The default app didn't succeed, so try 'xdg-open' / 'open' */
+      /* The default app didn't succeed, so try 'gio open' */
       g_autofree gchar *command = NULL;
       g_autofree gchar *uris = NULL;
 
       uris = _get_uris_string_from_list (uris_list);
+#if GLIB_CHECK_VERSION (2, 50, 0)
+      command = g_strdup_printf ("gio open %s", uris);
+#else
       command = g_strdup_printf ("gvfs-open %s", uris);
+#endif
       _spawn_command (command);
 
       if (error)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]