[gnome-software/wip/hughsie/fwupd_release_get_detach_image] fwupd: Fix manual detach for removable devices



commit f0548f0aaba1d94f75c3d1252d54af6be906c51d
Author: Richard Hughes <richard hughsie com>
Date:   Thu Sep 26 16:58:08 2019 +0100

    fwupd: Fix manual detach for removable devices
    
    Somewhat embarrassingly we were not actually showing the 8bitdo manual detach
    images because... we were not actually exporting them. I don't know how this
    ever worked, but it would also explain the low 'success' rate of the 8bitdo
    firmware on the LVFS.
    
    This will also be used by Logitech in the future for the C1 Unifying devices.

 plugins/fwupd/gs-fwupd-app.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/plugins/fwupd/gs-fwupd-app.c b/plugins/fwupd/gs-fwupd-app.c
index 7490e08f..78d123b6 100644
--- a/plugins/fwupd/gs-fwupd-app.c
+++ b/plugins/fwupd/gs-fwupd-app.c
@@ -213,4 +213,17 @@ gs_fwupd_app_set_from_release (GsApp *app, FwupdRelease *rel)
                if (tmp != NULL)
                        gs_app_set_update_details (app, tmp);
        }
+#if FWUPD_CHECK_VERSION(1,3,3)
+       if (fwupd_release_get_detach_image (rel) != NULL) {
+               g_autoptr(AsScreenshot) ss = as_screenshot_new ();
+               g_autoptr(AsImage) im = as_image_new ();
+               as_image_set_kind (im, AS_IMAGE_KIND_SOURCE);
+               as_image_set_url (im, fwupd_release_get_detach_image (rel));
+               as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT);
+               as_screenshot_add_image (ss, im);
+               if (fwupd_release_get_detach_caption (rel) != NULL)
+                       as_screenshot_set_caption (ss, NULL, fwupd_release_get_detach_caption (rel));
+               gs_app_add_screenshot (app, ss);
+       }
+#endif
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]