Blame SOURCES/0002-open-uri-Allow-skipping-chooser-for-more-URL-types.patch

e90b52
From 6e6b1ce9230da1936398267c2c39723b4a02a29b Mon Sep 17 00:00:00 2001
e90b52
From: Bastien Nocera <hadess@hadess.net>
e90b52
Date: Thu, 16 Apr 2020 16:31:32 +0200
e90b52
Subject: [PATCH 2/5] open-uri: Allow skipping chooser for more URL types
e90b52
e90b52
Also allow skipping the chooser to send mails, open FTP sites, or
e90b52
calendar items.
e90b52
e90b52
(cherry picked from commit 73928756aeaf1d10fed3486adbce92ba83ff9a6b)
e90b52
---
e90b52
 src/open-uri.c | 18 ++++++++++++++----
e90b52
 1 file changed, 14 insertions(+), 4 deletions(-)
e90b52
e90b52
diff --git a/src/open-uri.c b/src/open-uri.c
e90b52
index c0dd94e..35ba644 100644
e90b52
--- a/src/open-uri.c
e90b52
+++ b/src/open-uri.c
e90b52
@@ -448,10 +448,20 @@ static gboolean
e90b52
 can_skip_app_chooser (const char *scheme,
e90b52
                       const char *content_type)
e90b52
 {
e90b52
-  /* We skip the app chooser for Internet URIs, to be open in the browser */
e90b52
-  /*  Skipping the chooser for directories is useful too (e.g. opening in Nautilus) */
e90b52
-  if (g_strcmp0 (scheme, "http") == 0 ||
e90b52
-      g_strcmp0 (scheme, "https") == 0 ||
e90b52
+  const char *skipped_schemes[] = {
e90b52
+    "http",
e90b52
+    "https",
e90b52
+    "ftp",
e90b52
+    "mailto",
e90b52
+    "webcal",
e90b52
+    "calendar",
e90b52
+    NULL
e90b52
+  };
e90b52
+
e90b52
+  /* We skip the app chooser for Internet URIs, to be open in the browser,
e90b52
+   * mail client, or calendar, as well as for directories to be opened in
e90b52
+   * the file manager */
e90b52
+  if (g_strv_contains (skipped_schemes, scheme) ||
e90b52
       g_strcmp0 (content_type, "inode/directory") == 0)
e90b52
     {
e90b52
       g_debug ("Can skip app chooser for %s", content_type);
e90b52
-- 
e90b52
2.26.2
e90b52