summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2019-01-22 17:24:04 +0000
committerRichard Hughes <richard@hughsie.com>2019-01-22 17:24:23 +0000
commit6b44c80e6ba941933ac56faece29b28c237d4896 (patch)
tree36ba06330653c58bd7e0cb1aa4ff2822c24956da
parent57fc51353f939fa23538066edb4b0ad495e7cbee (diff)
downloadappstream-glib-6b44c80e6ba941933ac56faece29b28c237d4896.tar.gz
Add support for SOURCE URLs
These could be specified per-release or per-component as required.
-rw-r--r--libappstream-glib/as-enums.c4
-rw-r--r--libappstream-glib/as-enums.h2
2 files changed, 6 insertions, 0 deletions
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;