[gnome-software] fwupd: Get the AppstreamId metadata from fwupd
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] fwupd: Get the AppstreamId metadata from fwupd
- Date: Wed, 25 Nov 2015 16:47:28 +0000 (UTC)
commit a4ee428286c0000d3869251a2ded9b7d077ece86
Author: Richard Hughes <richard hughsie com>
Date: Wed Nov 25 16:40:01 2015 +0000
fwupd: Get the AppstreamId metadata from fwupd
This allows us to merge the data sources so we can get access to data that
fwupd does not care about, e.g. screenshots. It also allows us to ignore a lot
of the metadata sent by fwupd as it will already have been set in the AppStream
plugin.
src/plugins/gs-plugin-fwupd.c | 38 +++++---------------------------------
1 files changed, 5 insertions(+), 33 deletions(-)
---
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index 6b217f3..2bdd690 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -233,44 +233,16 @@ gs_plugin_fwupd_set_app_from_kv (GsApp *app, const gchar *key, GVariant *val)
{
g_debug ("key %s", key);
- if (g_strcmp0 (key, "Guid") == 0) {
+ if (g_strcmp0 (key, "AppstreamId") == 0) {
gs_app_set_id (app, g_variant_get_string (val, NULL));
return;
}
- if (g_strcmp0 (key, "Version") == 0) {
- gs_app_set_version (app, g_variant_get_string (val, NULL));
- return;
- }
- if (g_strcmp0 (key, "Vendor") == 0) {
- gs_app_set_origin (app, g_variant_get_string (val, NULL));
- return;
- }
- if (g_strcmp0 (key, "Name") == 0) {
- gs_app_add_source (app, g_variant_get_string (val, NULL));
- gs_app_set_name (app, GS_APP_QUALITY_NORMAL,
- g_variant_get_string (val, NULL));
- return;
- }
- if (g_strcmp0 (key, "Summary") == 0) {
- gs_app_set_summary (app, GS_APP_QUALITY_NORMAL,
- g_variant_get_string (val, NULL));
- return;
- }
- if (g_strcmp0 (key, "Description") == 0) {
- g_autofree gchar *tmp = NULL;
- tmp = as_markup_convert (g_variant_get_string (val, NULL),
- AS_MARKUP_CONVERT_FORMAT_SIMPLE, NULL);
- if (tmp != NULL)
- gs_app_set_description (app, GS_APP_QUALITY_HIGHEST, tmp);
- return;
- }
- if (g_strcmp0 (key, "UrlHomepage") == 0) {
- gs_app_set_url (app, AS_URL_KIND_HOMEPAGE,
- g_variant_get_string (val, NULL));
+ if (g_strcmp0 (key, "Guid") == 0) {
+ gs_app_set_metadata (app, "GUID", g_variant_get_string (val, NULL));
return;
}
- if (g_strcmp0 (key, "License") == 0) {
- gs_app_set_licence (app, g_variant_get_string (val, NULL));
+ if (g_strcmp0 (key, "Version") == 0) {
+ gs_app_set_version (app, g_variant_get_string (val, NULL));
return;
}
if (g_strcmp0 (key, "Size") == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]