From 6b44c80e6ba941933ac56faece29b28c237d4896 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 22 Jan 2019 17:24:04 +0000 Subject: Add support for SOURCE URLs These could be specified per-release or per-component as required. --- libappstream-glib/as-enums.c | 4 ++++ libappstream-glib/as-enums.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libappstream-glib/as-enums.c b/libappstream-glib/as-enums.c index a9ec19e..aa82498 100644 --- a/libappstream-glib/as-enums.c +++ b/libappstream-glib/as-enums.c @@ -97,6 +97,8 @@ as_url_kind_to_string (AsUrlKind url_kind) return as_ref_string_new_static ("translate"); if (url_kind == AS_URL_KIND_DETAILS) return as_ref_string_new_static ("details"); + if (url_kind == AS_URL_KIND_SOURCE) + return as_ref_string_new_static ("source"); return as_ref_string_new_static ("unknown"); } @@ -129,6 +131,8 @@ as_url_kind_from_string (const gchar *url_kind) return AS_URL_KIND_TRANSLATE; if (g_strcmp0 (url_kind, "details") == 0) return AS_URL_KIND_DETAILS; + if (g_strcmp0 (url_kind, "source") == 0) + return AS_URL_KIND_SOURCE; return AS_URL_KIND_UNKNOWN; } diff --git a/libappstream-glib/as-enums.h b/libappstream-glib/as-enums.h index a760b67..4f82d50 100644 --- a/libappstream-glib/as-enums.h +++ b/libappstream-glib/as-enums.h @@ -73,6 +73,7 @@ typedef enum { * @AS_URL_KIND_MISSING: The package is available, but missing * @AS_URL_KIND_TRANSLATE: Application translation page * @AS_URL_KIND_DETAILS: Release details + * @AS_URL_KIND_SOURCE: Link to source code * * The URL type. **/ @@ -86,6 +87,7 @@ typedef enum { AS_URL_KIND_MISSING, /* Since: 0.2.2 */ AS_URL_KIND_TRANSLATE, /* Since: 0.6.1 */ AS_URL_KIND_DETAILS, /* Since: 0.7.15 */ + AS_URL_KIND_SOURCE, /* Since: 0.7.15 */ /*< private >*/ AS_URL_KIND_LAST } AsUrlKind; -- cgit v1.2.1