[gnome-software] Support launching appstream://id



commit 822aa2397bb3531ee3b1845633d94346dc9b7f5a
Author: Iain Lane <iain orangesquash org uk>
Date:   Thu Jun 16 10:54:39 2016 +0100

    Support launching appstream://id

 src/gs-application.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 9be8a6b..eb25f05 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -923,8 +923,14 @@ gs_application_open (GApplication  *application,
                        continue;
 
                if (g_strcmp0 (soup_uri_get_scheme (uri), "appstream") == 0) {
+                       const gchar *host = soup_uri_get_host (uri);
                        const gchar *path = soup_uri_get_path (uri);
 
+                       /* appstream://foo -> scheme: appstream, host: foo, path: / */
+                       /* appstream:foo -> scheme: appstream, host: (empty string), path: /foo */
+                       if (host != NULL && (strlen (host) > 0))
+                               path = host;
+
                        /* trim any leading slashes */
                        while (*path == '/')
                                path++;


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