[gnome-software] Get release information from the AppStream metadata
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Get release information from the AppStream metadata
- Date: Tue, 22 Dec 2015 15:30:26 +0000 (UTC)
commit 1524d69f1709bce3f371a7cb254cd22e7bfcdb45
Author: Richard Hughes <richard hughsie com>
Date: Tue Dec 22 15:20:45 2015 +0000
Get release information from the AppStream metadata
src/plugins/appstream-common.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/appstream-common.c b/src/plugins/appstream-common.c
index 216ee33..95f21cc 100644
--- a/src/plugins/appstream-common.c
+++ b/src/plugins/appstream-common.c
@@ -275,7 +275,7 @@ gs_appstream_copy_metadata (GsApp *app, AsApp *item)
gboolean
gs_appstream_refine_app (GsPlugin *plugin, GsApp *app, AsApp *item, GError **error)
{
-
+ AsRelease *rel;
GHashTable *urls;
GPtrArray *pkgnames;
GPtrArray *kudos;
@@ -474,5 +474,22 @@ gs_appstream_refine_app (GsPlugin *plugin, GsApp *app, AsApp *item, GError **err
}
}
+ /* is there any update information */
+ rel = as_app_get_release_default (item);
+ if (rel != NULL) {
+ tmp = as_release_get_description (rel, NULL);
+ if (tmp != NULL) {
+ g_autofree gchar *desc = NULL;
+ desc = as_markup_convert (tmp,
+ AS_MARKUP_CONVERT_FORMAT_MARKDOWN,
+ error);
+ if (desc == NULL)
+ return FALSE;
+ gs_app_set_update_details (app, desc);
+ }
+ gs_app_set_update_urgency (app, as_release_get_urgency (rel));
+ gs_app_set_update_version (app, as_release_get_version (rel));
+ }
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]