diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2016-03-04 11:38:10 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2016-03-04 11:38:17 +1300 |
commit | 924326edc3eb5df7d062212ed8f622f361cd0313 (patch) | |
tree | 39f52f32a709a65c90d002cea01c06602b5587cf /libappstream-glib/as-node.c | |
parent | 216216cb52afdbfb3fef43c2e4f23e5ca2cb1104 (diff) | |
download | appstream-glib-924326edc3eb5df7d062212ed8f622f361cd0313.tar.gz |
Implement DEP-11 MediaBaseUrl support
Diffstat (limited to 'libappstream-glib/as-node.c')
-rw-r--r-- | libappstream-glib/as-node.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c index 340ee1e..bef6fbf 100644 --- a/libappstream-glib/as-node.c +++ b/libappstream-glib/as-node.c @@ -1930,6 +1930,7 @@ struct _AsNodeContext { AsAppSourceKind output; gdouble version; gboolean output_trusted; + gchar *media_base_url; }; /** @@ -2075,3 +2076,33 @@ as_node_context_set_output (AsNodeContext *ctx, AsAppSourceKind output) { ctx->output = output; } + +/** + * as_node_context_get_media_base_url: (skip) + * @ctx: a #AsNodeContext. + * + * Gets the base URL for media used when inserting nodes. + * + * Since: 0.5.11 + **/ +const gchar * +as_node_context_get_media_base_url (AsNodeContext *ctx) +{ + return ctx->media_base_url; +} + +/** + * as_node_context_set_media_base_url: (skip) + * @ctx: a #AsNodeContext. + * @url: a URL + * + * Sets the base URL for media used when inserting nodes. + * + * Since: 0.5.11 + **/ +void +as_node_context_set_media_base_url (AsNodeContext *ctx, const gchar *url) +{ + g_free (ctx->media_base_url); + ctx->media_base_url = g_strdup (url); +} |