[gnome-software] Allow linking to specified proprietary licenses
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Allow linking to specified proprietary licenses
- Date: Tue, 19 Sep 2017 08:47:44 +0000 (UTC)
commit 6f37832c72281115d4f3ff5e3a7820cd4edd1cb3
Author: Richard Hughes <richard hughsie com>
Date: Thu Sep 14 18:48:42 2017 +0100
Allow linking to specified proprietary licenses
src/gs-details-page.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 7037bc1..0eb7426 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -2159,7 +2159,18 @@ gs_details_page_license_nonfree_cb (GtkWidget *widget, GsDetailsPage *self)
{
g_autofree gchar *str = NULL;
g_autofree gchar *uri = NULL;
- uri = g_settings_get_string (self->settings, "nonfree-software-uri");
+ g_auto(GStrv) tokens = NULL;
+
+ /* license specified as a link */
+ tokens = as_utils_spdx_license_tokenize (gs_app_get_license (self->app));
+ for (guint i = 0; tokens[i] != NULL; i++) {
+ if (g_str_has_prefix (tokens[i], "@LicenseRef-proprietary=")) {
+ uri = g_strdup (tokens[i] + 24);
+ break;
+ }
+ }
+ if (uri == NULL)
+ uri = g_settings_get_string (self->settings, "nonfree-software-uri");
str = g_strdup_printf ("<a href=\"%s\">%s</a>",
uri,
_("More information"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]