mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 14:01:06 +00:00
Add an 'Summary' property to each device
This was already exported in the libfwupd API, but it had no way of being set from devices or passed from daemon to client.
This commit is contained in:
parent
48ad97fd61
commit
6c6e8d3ab8
@ -788,6 +788,11 @@ fwupd_device_to_variant_builder (FwupdDevice *device, GVariantBuilder *builder)
|
||||
FWUPD_RESULT_KEY_DEVICE_DESCRIPTION,
|
||||
g_variant_new_string (priv->description));
|
||||
}
|
||||
if (priv->summary != NULL) {
|
||||
g_variant_builder_add (builder, "{sv}",
|
||||
FWUPD_RESULT_KEY_DEVICE_SUMMARY,
|
||||
g_variant_new_string (priv->summary));
|
||||
}
|
||||
if (priv->checksums->len > 0) {
|
||||
g_autoptr(GString) str = g_string_new ("");
|
||||
for (guint i = 0; i < priv->checksums->len; i++) {
|
||||
@ -893,6 +898,10 @@ fwupd_device_from_key_value (FwupdDevice *device, const gchar *key, GVariant *va
|
||||
fwupd_device_set_vendor_id (device, g_variant_get_string (value, NULL));
|
||||
return;
|
||||
}
|
||||
if (g_strcmp0 (key, FWUPD_RESULT_KEY_DEVICE_SUMMARY) == 0) {
|
||||
fwupd_device_set_summary (device, g_variant_get_string (value, NULL));
|
||||
return;
|
||||
}
|
||||
if (g_strcmp0 (key, FWUPD_RESULT_KEY_DEVICE_DESCRIPTION) == 0) {
|
||||
fwupd_device_set_description (device, g_variant_get_string (value, NULL));
|
||||
return;
|
||||
@ -1015,6 +1024,7 @@ fwupd_device_to_string (FwupdDevice *device)
|
||||
const gchar *guid = g_ptr_array_index (priv->guids, i);
|
||||
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_GUID, guid);
|
||||
}
|
||||
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_SUMMARY, priv->summary);
|
||||
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_DESCRIPTION, priv->description);
|
||||
fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_PLUGIN, priv->provider);
|
||||
fwupd_pad_kv_dfl (str, FWUPD_RESULT_KEY_DEVICE_FLAGS, priv->flags);
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
/* FIXME: change the keys to the new names when we bump major version */
|
||||
#define FWUPD_RESULT_KEY_DEVICE_CREATED "Created" /* t */
|
||||
#define FWUPD_RESULT_KEY_DEVICE_SUMMARY "Summary" /* s */
|
||||
#define FWUPD_RESULT_KEY_DEVICE_DESCRIPTION "Description" /* s */
|
||||
#define FWUPD_RESULT_KEY_DEVICE_FLAGS "Flags" /* t */
|
||||
#define FWUPD_RESULT_KEY_DEVICE_CHECKSUM "FirmwareHash" /* s */
|
||||
|
@ -49,6 +49,7 @@ FuDevice *fu_device_new (void);
|
||||
#define fu_device_set_id(d,v) fwupd_device_set_id(fwupd_result_get_device(FWUPD_RESULT(d)),v)
|
||||
#define fu_device_set_modified(d,v) fwupd_device_set_modified(fwupd_result_get_device(FWUPD_RESULT(d)),v)
|
||||
#define fu_device_set_plugin(d,v) fwupd_device_set_provider(fwupd_result_get_device(FWUPD_RESULT(d)),v)
|
||||
#define fu_device_set_summary(d,v) fwupd_device_set_summary(fwupd_result_get_device(FWUPD_RESULT(d)),v)
|
||||
#define fu_device_set_unique_id(d,v) fwupd_result_set_unique_id(FWUPD_RESULT(d),v)
|
||||
#define fu_device_set_update_description(d,v) fwupd_release_set_description(fwupd_result_get_release(FWUPD_RESULT(d)),v)
|
||||
#define fu_device_set_update_error(d,v) fwupd_result_set_update_error(FWUPD_RESULT(d),v)
|
||||
|
Loading…
Reference in New Issue
Block a user