[gnome-software: 2/3] flatpak: Ensure ref details are set when refining renamed apps




commit 2766fea90bf09b65cfd788b1471429e53f514c25
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Jan 28 11:50:44 2021 +0000

    flatpak: Ensure ref details are set when refining renamed apps
    
    The `FlatpakRef` metadata need to be set on a `GsApp` before it can be
    refined to its renamed form. This happened when handling renames for
    apps returned through normal code paths, but not for apps returned
    through AppStream searches. In that case, the `GsApp` had come directly
    from `gs_app_new()` inside the AppStream code, and not
    `gs_flatpak_create_app()`.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 plugins/flatpak/gs-flatpak.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 79d7a29a6..14ccfbdf4 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -2586,6 +2586,9 @@ gs_flatpak_refine_appstream (GsFlatpak *self,
                                 origin, source_safe);
        component = xb_silo_query_first (silo, xpath, &error_local);
 
+       /* Ensure the gs_flatpak_app_get_ref_*() metadata are set */
+       gs_refine_item_metadata (self, app, NULL, NULL);
+
        /* If the app was renamed, use the appstream data from the new name;
         * usually it will not exist under the old name */
        if (component == NULL && gs_flatpak_app_get_ref_kind (app) == FLATPAK_REF_KIND_APP)


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